Skip to content

Commit

Permalink
add log for decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantran1702 committed May 27, 2024
1 parent eb6c1f6 commit a51b18d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/feeabs/ante/decorate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit a51b18d

Please sign in to comment.