mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
Merge remote-tracking branch 'refs/remotes/ethereum/master'
Conflicts: cmd/gexp/main.go
This commit is contained in:
commit
00bf780118
5 changed files with 15 additions and 13 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
1.2.2
|
1.2.3
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ import (
|
||||||
const (
|
const (
|
||||||
|
|
||||||
ClientIdentifier = "Gexp"
|
ClientIdentifier = "Gexp"
|
||||||
Version = "1.2.2"
|
Version = "1.2.3"
|
||||||
VersionMajor = 1
|
VersionMajor = 1
|
||||||
VersionMinor = 2
|
VersionMinor = 2
|
||||||
VersionPatch = 2
|
VersionPatch = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ type Environment interface {
|
||||||
|
|
||||||
Origin() common.Address
|
Origin() common.Address
|
||||||
BlockNumber() *big.Int
|
BlockNumber() *big.Int
|
||||||
GetHash(n uint64) common.Hash
|
// The n'th hash ago from this block number
|
||||||
|
GetHash(uint64) common.Hash
|
||||||
|
// The handler's address
|
||||||
Coinbase() common.Address
|
Coinbase() common.Address
|
||||||
Time() *big.Int
|
Time() *big.Int
|
||||||
Difficulty() *big.Int
|
Difficulty() *big.Int
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,10 @@ func (self *VMEnv) SetDepth(i int) { self.depth = i }
|
||||||
func (self *VMEnv) VmType() vm.Type { return self.typ }
|
func (self *VMEnv) VmType() vm.Type { return self.typ }
|
||||||
func (self *VMEnv) SetVmType(t vm.Type) { self.typ = t }
|
func (self *VMEnv) SetVmType(t vm.Type) { self.typ = t }
|
||||||
func (self *VMEnv) GetHash(n uint64) common.Hash {
|
func (self *VMEnv) GetHash(n uint64) common.Hash {
|
||||||
if block := self.chain.GetBlockByNumber(n); block != nil {
|
for block := self.chain.GetBlock(self.header.ParentHash); block != nil; block = self.chain.GetBlock(block.ParentHash()) {
|
||||||
return block.Hash()
|
if block.NumberU64() == n {
|
||||||
|
return block.Hash()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return common.Hash{}
|
return common.Hash{}
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,8 @@ type Env struct {
|
||||||
initial bool
|
initial bool
|
||||||
Gas *big.Int
|
Gas *big.Int
|
||||||
|
|
||||||
origin common.Address
|
origin common.Address
|
||||||
//parent common.Hash
|
parent common.Hash
|
||||||
coinbase common.Address
|
coinbase common.Address
|
||||||
|
|
||||||
number *big.Int
|
number *big.Int
|
||||||
|
|
@ -164,7 +164,7 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
|
||||||
env := NewEnv(state)
|
env := NewEnv(state)
|
||||||
|
|
||||||
env.origin = common.HexToAddress(exeValues["caller"])
|
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.coinbase = common.HexToAddress(envValues["currentCoinbase"])
|
||||||
env.number = common.Big(envValues["currentNumber"])
|
env.number = common.Big(envValues["currentNumber"])
|
||||||
env.time = common.Big(envValues["currentTimestamp"])
|
env.time = common.Big(envValues["currentTimestamp"])
|
||||||
|
|
@ -175,10 +175,8 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
|
||||||
return env
|
return env
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Env) Origin() common.Address { return self.origin }
|
func (self *Env) Origin() common.Address { return self.origin }
|
||||||
func (self *Env) BlockNumber() *big.Int { return self.number }
|
func (self *Env) BlockNumber() *big.Int { return self.number }
|
||||||
|
|
||||||
//func (self *Env) PrevHash() []byte { return self.parent }
|
|
||||||
func (self *Env) Coinbase() common.Address { return self.coinbase }
|
func (self *Env) Coinbase() common.Address { return self.coinbase }
|
||||||
func (self *Env) Time() *big.Int { return self.time }
|
func (self *Env) Time() *big.Int { return self.time }
|
||||||
func (self *Env) Difficulty() *big.Int { return self.difficulty }
|
func (self *Env) Difficulty() *big.Int { return self.difficulty }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue