ante, evm: fix panic when checking BlockGasMeter (#120)

* ante, evm: fix panic when checking BlockGasMeter

* update block gas limit function
This commit is contained in:
Federico Kunze
2021-06-14 10:24:08 -04:00
committed by GitHub
parent 9d18414c93
commit bb91d8d93d
6 changed files with 42 additions and 16 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
ethermint "github.com/cosmos/ethermint/types"
"github.com/cosmos/ethermint/x/evm/types"
"github.com/ethereum/go-ethereum/common"
@@ -30,7 +31,7 @@ func (k *Keeper) NewEVM(msg core.Message, config *params.ChainConfig) *vm.EVM {
Transfer: core.Transfer,
GetHash: k.GetHashFn(),
Coinbase: common.Address{}, // there's no beneficiary since we're not mining
GasLimit: k.ctx.BlockGasMeter().Limit(),
GasLimit: ethermint.BlockGasLimit(k.ctx),
BlockNumber: big.NewInt(k.ctx.BlockHeight()),
Time: big.NewInt(k.ctx.BlockHeader().Time.Unix()),
Difficulty: big.NewInt(0), // unused. Only required in PoW context
-9
View File
@@ -1,9 +0,0 @@
package types
// Constants to match up protocol versions and messages
const (
eth65 = 65
// ProtocolVersion is the latest supported version of the eth protocol.
ProtocolVersion = eth65
)