From dffc6aa57fd81d2d11040679b694e86cffa84bb9 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Mon, 16 Sep 2024 17:28:10 -0400 Subject: [PATCH] Removed redundant debugging print statements in supply_test.go and streamlined the blockchain logger initialization by deleting unnecessary blocks. This enhances code readability and maintains cleaner logs during blockchain setup. --- core/blockchain.go | 19 ------------------- eth/tracers/internal/tracetest/supply_test.go | 4 ---- 2 files changed, 23 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index e120f5e68e4d..d1411003d8cc 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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 diff --git a/eth/tracers/internal/tracetest/supply_test.go b/eth/tracers/internal/tracetest/supply_test.go index d7695cda0f0e..1d103756cc5e 100644 --- a/eth/tracers/internal/tracetest/supply_test.go +++ b/eth/tracers/internal/tracetest/supply_test.go @@ -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)