diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-24 18:04:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-24 18:04:15 +0800 |
commit | 32d125131f602d63f66ee7eb09439074f0b94a91 (patch) | |
tree | de8cdb558d390f8200962af2d24d4402b6762409 /ethchain/state_test.go | |
parent | 958b482ada677028e11698c219ed5b1e70b224e6 (diff) | |
download | dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.gz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.bz2 dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.lz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.xz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.zst dexon-32d125131f602d63f66ee7eb09439074f0b94a91.zip |
Refactored to new state and vm
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") - } -} |