aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm_env.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm_env.go')
-rw-r--r--core/vm_env.go10
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 }