diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-02-23 06:29:59 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-02-23 06:29:59 +0800 |
commit | 024d41d0c2660d8f1dfbeb14921c7109e30493a2 (patch) | |
tree | a2b4ed630b84084c7f439d1539ed0551ec729cbd /core/state/state_test.go | |
parent | 46ec4357e73dd0c43951d11638d9aed94f8ffd29 (diff) | |
download | go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.gz go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.bz2 go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.lz go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.xz go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.zst go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.zip |
core, core/state, core/vm: remove exported account getters (#3618)
Removed exported statedb object accessors, reducing the chance for nasty
bugs to creep in. It's also ugly and unnecessary to have these methods.
Diffstat (limited to 'core/state/state_test.go')
-rw-r--r-- | core/state/state_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/state/state_test.go b/core/state/state_test.go index 435d1d829..3bc63c148 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -152,7 +152,7 @@ func TestSnapshot2(t *testing.T) { state.SetState(stateobjaddr1, storageaddr, data1) // db, trie are already non-empty values - so0 := state.GetStateObject(stateobjaddr0) + so0 := state.getStateObject(stateobjaddr0) so0.SetBalance(big.NewInt(42)) so0.SetNonce(43) so0.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e'}), []byte{'c', 'a', 'f', 'e'}) @@ -164,7 +164,7 @@ func TestSnapshot2(t *testing.T) { state.Reset(root) // and one with deleted == true - so1 := state.GetStateObject(stateobjaddr1) + so1 := state.getStateObject(stateobjaddr1) so1.SetBalance(big.NewInt(52)) so1.SetNonce(53) so1.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e', '2'}), []byte{'c', 'a', 'f', 'e', '2'}) @@ -172,7 +172,7 @@ func TestSnapshot2(t *testing.T) { so1.deleted = true state.setStateObject(so1) - so1 = state.GetStateObject(stateobjaddr1) + so1 = state.getStateObject(stateobjaddr1) if so1 != nil { t.Fatalf("deleted object not nil when getting") } @@ -180,7 +180,7 @@ func TestSnapshot2(t *testing.T) { snapshot := state.Snapshot() state.RevertToSnapshot(snapshot) - so0Restored := state.GetStateObject(stateobjaddr0) + so0Restored := state.getStateObject(stateobjaddr0) // Update lazily-loaded values before comparing. so0Restored.GetState(db, storageaddr) so0Restored.Code(db) @@ -188,13 +188,13 @@ func TestSnapshot2(t *testing.T) { compareStateObjects(so0Restored, so0, t) // deleted should be nil, both before and after restore of state copy - so1Restored := state.GetStateObject(stateobjaddr1) + so1Restored := state.getStateObject(stateobjaddr1) if so1Restored != nil { t.Fatalf("deleted object not nil after restoring snapshot: %+v", so1Restored) } } -func compareStateObjects(so0, so1 *StateObject, t *testing.T) { +func compareStateObjects(so0, so1 *stateObject, t *testing.T) { if so0.Address() != so1.Address() { t.Fatalf("Address mismatch: have %v, want %v", so0.address, so1.address) } |