aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/blockchain_test.go')
-rw-r--r--core/blockchain_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/blockchain_test.go b/core/blockchain_test.go
index 7505208e1..371522ab7 100644
--- a/core/blockchain_test.go
+++ b/core/blockchain_test.go
@@ -131,7 +131,7 @@ func testBlockChainImport(chain types.Blocks, blockchain *BlockChain) error {
}
return err
}
- statedb, err := state.New(blockchain.GetBlockByHash(block.ParentHash()).Root(), blockchain.chainDb)
+ statedb, err := state.New(blockchain.GetBlockByHash(block.ParentHash()).Root(), blockchain.stateCache)
if err != nil {
return err
}
@@ -148,7 +148,7 @@ func testBlockChainImport(chain types.Blocks, blockchain *BlockChain) error {
blockchain.mu.Lock()
WriteTd(blockchain.chainDb, block.Hash(), block.NumberU64(), new(big.Int).Add(block.Difficulty(), blockchain.GetTdByHash(block.ParentHash())))
WriteBlock(blockchain.chainDb, block)
- statedb.Commit(false)
+ statedb.CommitTo(blockchain.chainDb, false)
blockchain.mu.Unlock()
}
return nil
@@ -1131,7 +1131,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
if _, err := blockchain.InsertChain(types.Blocks{blocks[0]}); err != nil {
t.Fatal(err)
}
- if !blockchain.stateCache.Exist(theAddr) {
+ if st, _ := blockchain.State(); !st.Exist(theAddr) {
t.Error("expected account to exist")
}
@@ -1139,7 +1139,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
if _, err := blockchain.InsertChain(types.Blocks{blocks[1]}); err != nil {
t.Fatal(err)
}
- if blockchain.stateCache.Exist(theAddr) {
+ if st, _ := blockchain.State(); st.Exist(theAddr) {
t.Error("account should not exist")
}
@@ -1147,7 +1147,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
if _, err := blockchain.InsertChain(types.Blocks{blocks[2]}); err != nil {
t.Fatal(err)
}
- if blockchain.stateCache.Exist(theAddr) {
+ if st, _ := blockchain.State(); st.Exist(theAddr) {
t.Error("account should not exist")
}
}