Skip to content

Commit

Permalink
check fee-collector-address (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 authored Nov 19, 2023
1 parent 3ef7b78 commit f171b21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/feeabs/ante/decorate.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func (fadfd FeeAbstractionDeductFeeDecorate) AnteHandle(ctx sdk.Context, tx sdk.
return ctx, sdkerrors.Wrap(errorstypes.ErrTxDecode, "Tx must be a FeeTx")
}

if addr := fadfd.accountKeeper.GetModuleAddress(types.FeeCollectorName); addr == nil {
return ctx, fmt.Errorf("fee collector module account (%s) has not been set", types.FeeCollectorName)
}

fee := feeTx.GetFee()
if len(fee) == 0 {
return fadfd.normalDeductFeeAnteHandle(ctx, tx, simulate, next, feeTx)
Expand All @@ -52,10 +56,6 @@ func (fadfd FeeAbstractionDeductFeeDecorate) AnteHandle(ctx sdk.Context, tx sdk.
}

func (fadfd FeeAbstractionDeductFeeDecorate) normalDeductFeeAnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler, feeTx sdk.FeeTx) (newCtx sdk.Context, err error) {
if addr := fadfd.accountKeeper.GetModuleAddress(types.FeeCollectorName); addr == nil {
return ctx, fmt.Errorf("fee collector module account (%s) has not been set", types.FeeCollectorName)
}

fee := feeTx.GetFee()
feePayer := feeTx.FeePayer()
feeGranter := feeTx.FeeGranter()
Expand Down

0 comments on commit f171b21

Please sign in to comment.