From c99d5cf6c5ca0b4e667fc55d72292b5eef04a7b2 Mon Sep 17 00:00:00 2001 From: Austin Abell Date: Thu, 9 Jan 2020 09:03:39 +1300 Subject: [PATCH] Switch EVM context to use header time (#167) --- x/evm/types/state_transition.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 493cf540..79047f1f 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -2,7 +2,6 @@ package types import ( "math/big" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" @@ -71,7 +70,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result) Origin: st.Sender, Coinbase: common.Address{}, BlockNumber: big.NewInt(ctx.BlockHeight()), - Time: big.NewInt(time.Now().Unix()), + Time: big.NewInt(ctx.BlockHeader().Time.Unix()), Difficulty: big.NewInt(0x30000), // unused GasLimit: gasLimit, GasPrice: ctx.MinGasPrices().AmountOf(emint.DenomDefault).Int,