diff --git a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go index f7d781bfd2..3a07546157 100644 --- a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go +++ b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go @@ -226,9 +226,13 @@ func (k Keeper) FundGasStabilityPoolFromRemainingFees(ctx sdk.Context, outboundT gasLimit := outboundTxParams.OutboundTxEffectiveGasLimit gasPrice := math.NewUintFromBigInt(outboundTxParams.OutboundTxEffectiveGasPrice.BigInt()) + if gasLimit == gasUsed { + return nil + } + // We skip gas stability pool funding if one of the params is zero if gasLimit > 0 && gasUsed > 0 && !gasPrice.IsZero() { - if gasLimit >= gasUsed { + if gasLimit > gasUsed { remainingGas := gasLimit - gasUsed remainingFees := math.NewUint(remainingGas).Mul(gasPrice).BigInt() diff --git a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx_test.go b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx_test.go index 1cb362df6f..b5ad6ab78d 100644 --- a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx_test.go +++ b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx_test.go @@ -26,6 +26,13 @@ func TestKeeper_FundGasStabilityPoolFromRemainingFees(t *testing.T) { fundStabilityPoolExpectedRemainingFee *big.Int isError bool }{ + { + name: "no call if gasLimit is equal to gasUsed", + effectiveGasLimit: 42, + gasUsed: 42, + effectiveGasPrice: math.NewInt(42), + expectFundStabilityPoolCall: false, + }, { name: "no call if gasLimit is 0", effectiveGasLimit: 0,