aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-10-21 08:31:46 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-21 08:31:46 +0800
commit80f26086eeb126cb87000f283cb5ccc3df95dbcc (patch)
tree298cd91b9102053a65cfb18ae4e43ca7980fb8f3 /tests
parent796952a49ac12caa3949587e22a7a03c30a8910c (diff)
downloadgo-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar.gz
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar.bz2
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar.lz
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar.xz
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.tar.zst
go-tangerine-80f26086eeb126cb87000f283cb5ccc3df95dbcc.zip
core, tests: get_hash fix
Make sure that we're fetching the hash from the current chain and not the canonical chain.
Diffstat (limited to 'tests')
-rw-r--r--tests/util.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/util.go b/tests/util.go
index bbc671169..571161683 100644
--- a/tests/util.go
+++ b/tests/util.go
@@ -131,8 +131,8 @@ type Env struct {
initial bool
Gas *big.Int
- origin common.Address
- //parent common.Hash
+ origin common.Address
+ parent common.Hash
coinbase common.Address
number *big.Int
@@ -163,7 +163,7 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
env := NewEnv(state)
env.origin = common.HexToAddress(exeValues["caller"])
- //env.parent = common.Hex2Bytes(envValues["previousHash"])
+ env.parent = common.HexToHash(envValues["previousHash"])
env.coinbase = common.HexToAddress(envValues["currentCoinbase"])
env.number = common.Big(envValues["currentNumber"])
env.time = common.Big(envValues["currentTimestamp"])
@@ -174,10 +174,8 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
return env
}
-func (self *Env) Origin() common.Address { return self.origin }
-func (self *Env) BlockNumber() *big.Int { return self.number }
-
-//func (self *Env) PrevHash() []byte { return self.parent }
+func (self *Env) Origin() common.Address { return self.origin }
+func (self *Env) BlockNumber() *big.Int { return self.number }
func (self *Env) Coinbase() common.Address { return self.coinbase }
func (self *Env) Time() *big.Int { return self.time }
func (self *Env) Difficulty() *big.Int { return self.difficulty }