diff --git a/core/blockchain.go b/core/blockchain.go index b31f915bc..0c5836bb9 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1334,6 +1334,7 @@ func (bc *BlockChain) writeKnownBlock(block *types.Block) error { // writeBlockWithState writes block, metadata and corresponding state data to the // database. func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.Receipt, state *state.StateDB) error { + log.Error("inside of the target function") // Calculate the total difficulty of the block ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1) if ptd == nil { diff --git a/core/plugeth_injection_test.go b/core/plugeth_injection_test.go index 06c10f51b..08108f242 100644 --- a/core/plugeth_injection_test.go +++ b/core/plugeth_injection_test.go @@ -134,6 +134,17 @@ func TestPlugethInjections(t *testing.T) { } }) + t.Run(fmt.Sprintf("test treiIntervarFlushClone"), func(t *testing.T) { + called := false + injectionCalled = &called + + _ = blockchain.writeBlockWithState(block, []*types.Receipt{}, statedb) + + if *injectionCalled != true { + t.Fatalf("pluginNewSideBlock injection in blockChain.writeBlockAndSetHead() not called") + } + }) + t.Run(fmt.Sprintf("test NewSideBlock"), func(t *testing.T) { called := false injectionCalled = &called @@ -144,4 +155,5 @@ func TestPlugethInjections(t *testing.T) { t.Fatalf("pluginNewSideBlock injection in blockChain.writeBlockAndSetHead() not called") } }) + } \ No newline at end of file