diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-09 05:30:07 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-09 05:30:07 +0800 |
commit | 204ac81188e43900835c6aa5bad6b3e48f3a16d0 (patch) | |
tree | 80b54ac93a0d42ffe595b852fa6c565d3f0d088e /core/state/managed_state_test.go | |
parent | 6e2f78ebdd4c8d0d150327400a16d67cb65fc482 (diff) | |
download | go-tangerine-204ac81188e43900835c6aa5bad6b3e48f3a16d0.tar.gz go-tangerine-204ac81188e43900835c6aa5bad6b3e48f3a16d0.tar.zst go-tangerine-204ac81188e43900835c6aa5bad6b3e48f3a16d0.zip |
Moved handling of nonces to the managed state
Diffstat (limited to 'core/state/managed_state_test.go')
-rw-r--r-- | core/state/managed_state_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/state/managed_state_test.go b/core/state/managed_state_test.go index 766231d21..c7ef2b323 100644 --- a/core/state/managed_state_test.go +++ b/core/state/managed_state_test.go @@ -4,12 +4,15 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" ) var addr = common.BytesToAddress([]byte("test")) func create() (*ManagedState, *account) { - ms := ManageState(&StateDB{stateObjects: make(map[string]*StateObject)}) + db, _ := ethdb.NewMemDatabase() + statedb := New(common.Hash{}, db) + ms := ManageState(statedb) so := &StateObject{address: addr, nonce: 100} ms.StateDB.stateObjects[addr.Str()] = so ms.accounts[addr.Str()] = newAccount(so) @@ -95,13 +98,13 @@ func TestSetNonce(t *testing.T) { ms.SetNonce(addr, 10) if ms.GetNonce(addr) != 10 { - t.Errorf("Expected nonce of 10, got", ms.GetNonce(addr)) + t.Error("Expected nonce of 10, got", ms.GetNonce(addr)) } addr[0] = 1 ms.StateDB.SetNonce(addr, 1) if ms.GetNonce(addr) != 1 { - t.Errorf("Expected nonce of 1, got", ms.GetNonce(addr)) + t.Error("Expected nonce of 1, got", ms.GetNonce(addr)) } } |