diff options
Diffstat (limited to 'ethchain/state_test.go')
-rw-r--r-- | ethchain/state_test.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/ethchain/state_test.go b/ethchain/state_test.go deleted file mode 100644 index 95be0f373..000000000 --- a/ethchain/state_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package ethchain - -import ( - "github.com/ethereum/eth-go/ethdb" - "github.com/ethereum/eth-go/ethutil" - "testing" -) - -func TestSnapshot(t *testing.T) { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "", "ETH") - - db, _ := ethdb.NewMemDatabase() - state := NewState(ethutil.NewTrie(db, "")) - - stateObject := NewContract([]byte("aa"), ethutil.Big1, ZeroHash256) - state.UpdateStateObject(stateObject) - stateObject.SetStorage(ethutil.Big("0"), ethutil.NewValue(42)) - - snapshot := state.Copy() - - stateObject = state.GetStateObject([]byte("aa")) - stateObject.SetStorage(ethutil.Big("0"), ethutil.NewValue(43)) - - state.Set(snapshot) - - stateObject = state.GetStateObject([]byte("aa")) - if !stateObject.GetStorage(ethutil.Big("0")).Cmp(ethutil.NewValue(42)) { - t.Error("Expected storage 0 to be 42") - } -} |