diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-05 13:49:08 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:52 +0800 |
commit | c66af2d7f54b14e856c3d3b6a98a961daf617216 (patch) | |
tree | 9f9ceb4abf1ead399de23abe9efe7f8ebbfe510b /core/evm.go | |
parent | a2daec1ea649de60557c382bb3756ddf2466b2b2 (diff) | |
download | go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar.gz go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar.bz2 go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar.lz go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar.xz go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.tar.zst go-tangerine-c66af2d7f54b14e856c3d3b6a98a961daf617216.zip |
core: validate roundHeight mapping in governance contract
Diffstat (limited to 'core/evm.go')
-rw-r--r-- | core/evm.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/evm.go b/core/evm.go index 2d58e33f8..7e25e1d52 100644 --- a/core/evm.go +++ b/core/evm.go @@ -18,6 +18,7 @@ package core import ( "math/big" + "sync" "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/consensus" @@ -33,6 +34,9 @@ type ChainContext interface { // GetHeader returns the hash corresponding to their hash. GetHeader(common.Hash, uint64) *types.Header + + // GetRoundHeightMap returns the mapping between round and height. + GetRoundHeightMap() sync.Map } // NewEVMContext creates a new context for use in the EVM. @@ -54,6 +58,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author Time: new(big.Int).SetUint64(header.Time), Randomness: header.Randomness, Difficulty: new(big.Int).Set(header.Difficulty), + RoundHeight: chain.GetRoundHeightMap(), GasLimit: header.GasLimit, GasPrice: new(big.Int).Set(msg.GasPrice()), } |