From ec2b399a8dc35d5b28e53fb497bb8d86353255ec Mon Sep 17 00:00:00 2001 From: lumtis Date: Mon, 16 Oct 2023 13:31:43 -0700 Subject: [PATCH] change check --- x/crosschain/keeper/gas_payment.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/crosschain/keeper/gas_payment.go b/x/crosschain/keeper/gas_payment.go index 0ff55ea65a..a370c7a672 100644 --- a/x/crosschain/keeper/gas_payment.go +++ b/x/crosschain/keeper/gas_payment.go @@ -227,9 +227,9 @@ func (k Keeper) PayGasInERC20AndUpdateCctx( // https://github.com/zeta-chain/node/issues/1303 // check if the final gas received after swap matches the gas fee defined // if not there might be issues with the pool liquidity and it is safer from an accounting perspective to return an error - //if gasObtained.Cmp(outTxGasFee.BigInt()) != 0 { - // return cosmoserrors.Wrapf(types.ErrInvalidGasAmount, "gas obtained for burn (%s) not equal to gas fee(%s)", gasObtained, outTxGasFee) - //} + if gasObtained.Cmp(outTxGasFee.BigInt()) == -1 { + return cosmoserrors.Wrapf(types.ErrInvalidGasAmount, "gas obtained for burn (%s) is lower than gas fee(%s)", gasObtained, outTxGasFee) + } // burn the gas ZRC20 err = k.fungibleKeeper.CallZRC20Burn(ctx, types.ModuleAddressEVM, gasZRC20, gasObtained, noEthereumTxEvent)