Skip to content

Commit

Permalink
Removed redundant debugging print statements in supply_test.go and st…
Browse files Browse the repository at this point in the history
…reamlined the blockchain logger initialization by deleting unnecessary blocks. This enhances code readability and maintains cleaner logs during blockchain setup.
  • Loading branch information
billettc committed Sep 16, 2024
1 parent 43b10f9 commit dffc6aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
19 changes: 0 additions & 19 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,25 +432,6 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
}
}

if bc.logger != nil && bc.logger.OnBlockchainInit != nil {
bc.logger.OnBlockchainInit(chainConfig)
}

if bc.logger != nil && bc.logger.OnGenesisBlock != nil {
if block := bc.CurrentBlock(); block.Number.Uint64() == 0 {
alloc, err := getGenesisState(bc.db, block.Hash())
if err != nil {
return nil, fmt.Errorf("failed to get genesis state: %w", err)
}

if alloc == nil {
return nil, fmt.Errorf("live blockchain tracer requires genesis alloc to be set")
}

bc.logger.OnGenesisBlock(bc.genesisBlock, alloc)
}
}

// Load any existing snapshot, regenerating it if loading failed
if bc.cacheConfig.SnapshotLimit > 0 {
// If the chain was rewound past the snapshot persistent layer (causing
Expand Down
4 changes: 0 additions & 4 deletions eth/tracers/internal/tracetest/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ func TestSupplyRewards(t *testing.T) {
if err != nil {
t.Fatalf("failed to test supply tracer: %v", err)
}
for i, el := range out {
b, _ := json.Marshal(el)
fmt.Println(i, string(b))
}
actual := out[expected.Number]

compareAsJSON(t, expected, actual)
Expand Down

0 comments on commit dffc6aa

Please sign in to comment.