aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-04-04 19:39:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-08 17:04:31 +0800
commit0e63a70505e0011d8f668dba86c99071cee9790e (patch)
tree084ea0bc35e2620e154a790e360df8c6994e5ff7 /core/blockchain_test.go
parentf1b00cffc828105c17c0ecacb2074874b752a9a0 (diff)
downloadgo-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar.gz
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar.bz2
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar.lz
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar.xz
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.tar.zst
go-tangerine-0e63a70505e0011d8f668dba86c99071cee9790e.zip
core: minor code polishes + rebase fixes
Diffstat (limited to 'core/blockchain_test.go')
-rw-r--r--core/blockchain_test.go10
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)}}}