Skip to content

Commit

Permalink
- taxable tx simulation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Sep 11, 2024
1 parent a5fed12 commit 4a3c59f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom/auth/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

errorsmod "cosmossdk.io/errors"

"github.com/classic-terra/core/v3/types/assets"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand Down Expand Up @@ -111,6 +112,16 @@ func (fd FeeDecorator) checkDeductFee(ctx sdk.Context, feeTx sdk.FeeTx, taxes sd
}
}

// it might also be that there is no taxes at all, then we need to add one
if len(taxes) == 0 {
denom := assets.MicroLunaDenom
if !fee.IsZero() {
denom = fee[0].Denom
}

taxes = sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10)))
}

if fee.IsZero() {
feesOrTax = taxes
}
Expand Down

0 comments on commit 4a3c59f

Please sign in to comment.