From a51b18d981cfd7453c0ba81da00e891c233deb5c Mon Sep 17 00:00:00 2001 From: Tuan Tran Date: Mon, 27 May 2024 21:57:10 +0700 Subject: [PATCH] add log for decorator --- x/feeabs/ante/decorate.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/feeabs/ante/decorate.go b/x/feeabs/ante/decorate.go index 30f70986..bd2ac8b0 100644 --- a/x/feeabs/ante/decorate.go +++ b/x/feeabs/ante/decorate.go @@ -283,10 +283,13 @@ func (famfd FeeAbstrationMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk nativeCoinsFees, err := famfd.feeabsKeeper.CalculateNativeFromIBCCoins(ctx, feeCoinsNonZeroDenom, hostChainConfig) if err != nil { - return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "insufficient fees") + return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "unable to calculate native fees from ibc fees: %s", err) } + fmt.Println("nativeCoinsFees", nativeCoinsFees) feeCoinsNonZeroDenom = nativeCoinsFees } + } else { + return ctx, sdkerrors.Wrapf(errorstypes.ErrNotSupported, "should have only one fee denom in feeCoinsNonZeroDenom, got %s", feeCoinsNonZeroDenom.String()) } // After replace the feeCoinsNonZeroDenom, feeCoinsNonZeroDenom must be in denom subset of nonZeroCoinFeesReq @@ -306,7 +309,7 @@ func (famfd FeeAbstrationMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk } if feeCoinsLen == 0 { - return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins, feeRequired) + return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "no fee provided, required: %s", feeRequired) } // After all the checks, the tx is confirmed: // feeCoins denoms subset off feeRequired (or replaced with fee-abstraction)