fix: minimal-gas-prices and baseFeePerGas conflicts (#916)

* Problem: minimal-gas-prices and baseFeePerGas conflicts

Closes: #915

Solution:
- Don't check min-gas-price for evm tx if london hardfork and feemarket enabled.

comments and cleanup

changelog

* fix zero fee coins

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2022-01-26 10:44:41 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent e39a74998e
commit 724a06632b
8 changed files with 56 additions and 76 deletions
+5
View File
@@ -66,6 +66,11 @@ func (k Keeper) DeductTxCostsFromUserBalance(
feeAmt = txData.Fee()
}
if feeAmt.Sign() == 0 {
// zero fee, no need to deduct
return sdk.NewCoins(), nil
}
fees := sdk.Coins{sdk.NewCoin(denom, sdk.NewIntFromBigInt(feeAmt))}
// deduct the full gas cost from the user balance
+4 -5
View File
@@ -330,11 +330,10 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing.
if err != nil {
return nil, err
}
fees := sdk.Coins{
{
Denom: evmDenom,
Amount: sdk.NewIntFromBigInt(txData.Fee()),
},
fees := make(sdk.Coins, 0)
feeAmt := sdk.NewIntFromBigInt(txData.Fee())
if feeAmt.Sign() > 0 {
fees = append(fees, sdk.NewCoin(evmDenom, feeAmt))
}
builder.SetExtensionOptions(option)