Switch EVM context to use header time (#167)

This commit is contained in:
Austin Abell 2020-01-09 09:03:39 +13:00 committed by GitHub
parent 35b16abe51
commit c99d5cf6c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ package types
import ( import (
"math/big" "math/big"
"time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
@ -71,7 +70,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result)
Origin: st.Sender, Origin: st.Sender,
Coinbase: common.Address{}, Coinbase: common.Address{},
BlockNumber: big.NewInt(ctx.BlockHeight()), BlockNumber: big.NewInt(ctx.BlockHeight()),
Time: big.NewInt(time.Now().Unix()), Time: big.NewInt(ctx.BlockHeader().Time.Unix()),
Difficulty: big.NewInt(0x30000), // unused Difficulty: big.NewInt(0x30000), // unused
GasLimit: gasLimit, GasLimit: gasLimit,
GasPrice: ctx.MinGasPrices().AmountOf(emint.DenomDefault).Int, GasPrice: ctx.MinGasPrices().AmountOf(emint.DenomDefault).Int,