From 4de267daa7c8f8025dc42a2ba905a58ce70a4c3d Mon Sep 17 00:00:00 2001 From: Freddy Li Date: Mon, 19 Apr 2021 14:24:03 -0400 Subject: [PATCH] merge pr #799 (#867) Co-authored-by: Freddy Li --- CHANGELOG.md | 1 + app/ante/eth.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9526b2e91..c7ac98f63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -209,6 +209,7 @@ corresponding Ethereum API namespace: ### Bug Fixes +* (evm) [\#799](https://github.com/cosmos/ethermint/issues/799) Fix wrong precision in calculation of gas fee. * (evm) [\#767](https://github.com/cosmos/ethermint/issues/767) Fix error of timeout when using Truffle to deploy contract. * (evm) [\#751](https://github.com/cosmos/ethermint/issues/751) Fix misused method to calculate block hash in evm related function. * (evm) [\#721](https://github.com/cosmos/ethermint/issues/721) Fix mismatch block hash in rpc response when use eth.getBlock. diff --git a/app/ante/eth.go b/app/ante/eth.go index 5dca8b60a..61006599d 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -99,7 +99,7 @@ func (emfd EthMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula evmDenom := emfd.evmKeeper.GetParams(ctx).EvmDenom // fee = gas price * gas limit - fee := sdk.NewDecCoin(evmDenom, sdk.NewIntFromBigInt(msgEthTx.Fee())) + fee := sdk.NewDecCoinFromDec(evmDenom, sdk.NewDecFromBigIntWithPrec(msgEthTx.Fee(), sdk.Precision)) minGasPrices := ctx.MinGasPrices() minFees := minGasPrices.AmountOf(evmDenom).MulInt64(int64(msgEthTx.Data.GasLimit))