Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Fix wrong precision in calculation of gas fee #798

Merged
merged 14 commits into from
Mar 15, 2021
Merged
2 changes: 1 addition & 1 deletion app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
KamiD marked this conversation as resolved.
Show resolved Hide resolved

minGasPrices := ctx.MinGasPrices()
minFees := minGasPrices.AmountOf(evmDenom).MulInt64(int64(msgEthTx.Data.GasLimit))
Expand Down