diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-04 18:40:20 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-04 18:40:20 +0800 |
commit | f298ffdbb8ec2b14f254e880a65f22f4d7c66305 (patch) | |
tree | 59b0edc06529785afef7c103e9bdbd4248ec58da /tests/helper | |
parent | 3664cd58e3631fccf4d9aba1932e0bb63ad442a6 (diff) | |
download | go-tangerine-f298ffdbb8ec2b14f254e880a65f22f4d7c66305.tar.gz go-tangerine-f298ffdbb8ec2b14f254e880a65f22f4d7c66305.tar.zst go-tangerine-f298ffdbb8ec2b14f254e880a65f22f4d7c66305.zip |
Renamed State => StateDB
Diffstat (limited to 'tests/helper')
-rw-r--r-- | tests/helper/vm.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/helper/vm.go b/tests/helper/vm.go index e0d5adb15..f32f98694 100644 --- a/tests/helper/vm.go +++ b/tests/helper/vm.go @@ -12,7 +12,7 @@ import ( type Env struct { depth int - state *state.State + state *state.StateDB skipTransfer bool Gas *big.Int @@ -28,13 +28,13 @@ type Env struct { logs state.Logs } -func NewEnv(state *state.State) *Env { +func NewEnv(state *state.StateDB) *Env { return &Env{ state: state, } } -func NewEnvFromMap(state *state.State, envValues map[string]string, exeValues map[string]string) *Env { +func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues map[string]string) *Env { env := NewEnv(state) env.origin = ethutil.Hex2Bytes(exeValues["caller"]) @@ -55,7 +55,7 @@ func (self *Env) Coinbase() []byte { return self.coinbase } func (self *Env) Time() int64 { return self.time } func (self *Env) Difficulty() *big.Int { return self.difficulty } func (self *Env) BlockHash() []byte { return nil } -func (self *Env) State() *state.State { return self.state } +func (self *Env) State() *state.StateDB { return self.state } func (self *Env) GasLimit() *big.Int { return self.gasLimit } func (self *Env) AddLog(log *state.Log) { self.logs = append(self.logs, log) @@ -91,7 +91,7 @@ func (self *Env) Create(caller vm.ClosureRef, addr, data []byte, gas, price, val return exe.Create(caller) } -func RunVm(state *state.State, env, exec map[string]string) ([]byte, state.Logs, *big.Int, error) { +func RunVm(state *state.StateDB, env, exec map[string]string) ([]byte, state.Logs, *big.Int, error) { var ( to = FromHex(exec["address"]) from = FromHex(exec["caller"]) @@ -110,7 +110,7 @@ func RunVm(state *state.State, env, exec map[string]string) ([]byte, state.Logs, return ret, vmenv.logs, vmenv.Gas, err } -func RunState(state *state.State, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) { +func RunState(state *state.StateDB, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) { var ( keyPair, _ = crypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(tx["secretKey"]))) to = FromHex(tx["to"]) |