aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm_env.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-18 22:18:13 +0800
committerobscuren <geffobscura@gmail.com>2014-12-18 22:18:13 +0800
commitdb494170dc819b1eb0d267b6e1ab36c6cfb63569 (patch)
tree8e2b374519a0ae5e20a9db0c2a4a86bf3375329e /core/vm_env.go
parent9e286e1c337319f47b2b04e9e1022ac05470a296 (diff)
downloadgo-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar
go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.gz
go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.bz2
go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.lz
go-tangerine-db494170dc819b1eb0d267b6e1ab36c6cfb63569.tar.xz
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.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 }