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_object_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_object_test.go')
-rw-r--r-- | ethchain/state_object_test.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/ethchain/state_object_test.go b/ethchain/state_object_test.go deleted file mode 100644 index 2588100d0..000000000 --- a/ethchain/state_object_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package ethchain - -import ( - "fmt" - "github.com/ethereum/eth-go/ethdb" - "github.com/ethereum/eth-go/ethutil" - "math/big" - "testing" -) - -func TestSync(t *testing.T) { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "", "ETH") - - db, _ := ethdb.NewMemDatabase() - state := NewState(ethutil.NewTrie(db, "")) - - contract := NewContract([]byte("aa"), ethutil.Big1, ZeroHash256) - - contract.script = []byte{42} - - state.UpdateStateObject(contract) - state.Sync() - - object := state.GetStateObject([]byte("aa")) - if len(object.Script()) == 0 { - t.Fail() - } -} - -func TestObjectGet(t *testing.T) { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "", "ETH") - - db, _ := ethdb.NewMemDatabase() - ethutil.Config.Db = db - - state := NewState(ethutil.NewTrie(db, "")) - - contract := NewContract([]byte("aa"), ethutil.Big1, ZeroHash256) - state.UpdateStateObject(contract) - - contract = state.GetStateObject([]byte("aa")) - contract.SetStorage(big.NewInt(0), ethutil.NewValue("hello")) - o := contract.GetMem(big.NewInt(0)) - fmt.Println(o) - - state.UpdateStateObject(contract) - contract.SetStorage(big.NewInt(0), ethutil.NewValue("hello00")) - - contract = state.GetStateObject([]byte("aa")) - o = contract.GetMem(big.NewInt(0)) - fmt.Println("after", o) -} |