diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-22 21:22:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-22 21:22:21 +0800 |
commit | b5beb1aac11af92bfe0f3ed7560b9eb08495ed09 (patch) | |
tree | 3f3fba73bca00f8c0a6c9f8bc29bca8ba36e991d /tests/helper | |
parent | 27cb0750c1deaed040876abdab1386a6687d7999 (diff) | |
download | dexon-b5beb1aac11af92bfe0f3ed7560b9eb08495ed09.tar.gz dexon-b5beb1aac11af92bfe0f3ed7560b9eb08495ed09.tar.zst dexon-b5beb1aac11af92bfe0f3ed7560b9eb08495ed09.zip |
added a transfer method to vm env
Diffstat (limited to 'tests/helper')
-rw-r--r-- | tests/helper/vm.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/helper/vm.go b/tests/helper/vm.go index a3d54de23..06c3d4eca 100644 --- a/tests/helper/vm.go +++ b/tests/helper/vm.go @@ -50,11 +50,14 @@ func (self *Env) Difficulty() *big.Int { return self.difficulty } func (self *Env) BlockHash() []byte { return nil } func (self *Env) State() *ethstate.State { return self.state } func (self *Env) GasLimit() *big.Int { return self.gasLimit } +func (self *Env) Transfer(from, to vm.Account, amount *big.Int) error { + return nil +} func RunVm(state *ethstate.State, env, exec map[string]string) ([]byte, *big.Int, error) { address := FromHex(exec["address"]) caller := state.GetOrNewStateObject(FromHex(exec["caller"])) - caller.Balance = ethutil.Big(exec["value"]) + caller.SetBalance(ethutil.Big(exec["value"])) evm := vm.New(NewEnvFromMap(state, env, exec), vm.DebugVmTy) |