diff options
Diffstat (limited to 'core/blockchain_test.go')
-rw-r--r-- | core/blockchain_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 7c76f1fc4..e1a0f33b7 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -934,6 +934,7 @@ func TestLogRebirth(t *testing.T) { key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") addr1 = crypto.PubkeyToAddress(key1.PublicKey) db = ethdb.NewMemDatabase() + // this code generates a log code = common.Hex2Bytes("60606040525b7f24ec1d3ff24c2f6ff210738839dbc339cd45a5294d85c79361016243157aae7b60405180905060405180910390a15b600a8060416000396000f360606040526008565b00") gspec = &Genesis{Config: params.TestChainConfig, Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(10000000000000)}}} @@ -1035,10 +1036,6 @@ func TestLogRebirth(t *testing.T) { if _, err := blockchain.InsertChain(newBlocks); err != nil { t.Fatalf("failed to insert forked chain: %v", err) } - // Rebirth logs should omit a newLogEvent - if !<-newLogCh { - t.Fatalf("failed to receive new log event") - } // Ensure removedLog events received select { case ev := <-rmLogsCh: @@ -1048,6 +1045,10 @@ func TestLogRebirth(t *testing.T) { case <-time.NewTimer(1 * time.Second).C: t.Fatal("Timeout. There is no RemovedLogsEvent has been sent.") } + // Rebirth logs should omit a newLogEvent + if !<-newLogCh { + t.Fatalf("failed to receive new log event") + } } func TestSideLogRebirth(t *testing.T) { @@ -1055,6 +1056,7 @@ func TestSideLogRebirth(t *testing.T) { key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") addr1 = crypto.PubkeyToAddress(key1.PublicKey) db = ethdb.NewMemDatabase() + // this code generates a log code = common.Hex2Bytes("60606040525b7f24ec1d3ff24c2f6ff210738839dbc339cd45a5294d85c79361016243157aae7b60405180905060405180910390a15b600a8060416000396000f360606040526008565b00") gspec = &Genesis{Config: params.TestChainConfig, Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(10000000000000)}}} |