diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-18 22:18:13 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-18 22:18:13 +0800 |
commit | db494170dc819b1eb0d267b6e1ab36c6cfb63569 (patch) | |
tree | 8e2b374519a0ae5e20a9db0c2a4a86bf3375329e /core/vm_env.go | |
parent | 9e286e1c337319f47b2b04e9e1022ac05470a296 (diff) | |
download | go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.gz go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.zst go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.zip |
Created generic message (easy for testing)
Diffstat (limited to 'core/vm_env.go')
-rw-r--r-- | core/vm_env.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/vm_env.go b/core/vm_env.go index 9e1815188..0b6744972 100644 --- a/core/vm_env.go +++ b/core/vm_env.go @@ -11,26 +11,26 @@ import ( type VMEnv struct { state *state.StateDB block *types.Block - tx *types.Transaction + msg Message depth int } -func NewEnv(state *state.StateDB, tx *types.Transaction, block *types.Block) *VMEnv { +func NewEnv(state *state.StateDB, msg Message, block *types.Block) *VMEnv { return &VMEnv{ state: state, block: block, - tx: tx, + msg: msg, } } -func (self *VMEnv) Origin() []byte { return self.tx.Sender() } +func (self *VMEnv) Origin() []byte { return self.msg.From() } func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number } func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash } func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase } func (self *VMEnv) Time() int64 { return self.block.Time } func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty } func (self *VMEnv) BlockHash() []byte { return self.block.Hash() } -func (self *VMEnv) Value() *big.Int { return self.tx.Value } +func (self *VMEnv) Value() *big.Int { return self.msg.Value() } func (self *VMEnv) State() *state.StateDB { return self.state } func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit } func (self *VMEnv) Depth() int { return self.depth } |