Skip to content

Commit

Permalink
fix: do not BurnTaxSplit when simulating (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
alchemist-ti authored Sep 4, 2023
1 parent bc62b1a commit f75ef44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom/auth/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (fd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, nex
}
}

if err := fd.checkDeductFee(ctx, feeTx, taxes); err != nil {
if err := fd.checkDeductFee(ctx, feeTx, taxes, simulate); err != nil {
return ctx, err
}

Expand All @@ -65,7 +65,7 @@ func (fd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, nex
return next(newCtx, tx, simulate)
}

func (fd FeeDecorator) checkDeductFee(ctx sdk.Context, feeTx sdk.FeeTx, taxes sdk.Coins) error {
func (fd FeeDecorator) checkDeductFee(ctx sdk.Context, feeTx sdk.FeeTx, taxes sdk.Coins, simulate bool) error {
if addr := fd.accountKeeper.GetModuleAddress(types.FeeCollectorName); addr == nil {
return fmt.Errorf("fee collector module account (%s) has not been set", types.FeeCollectorName)
}
Expand Down Expand Up @@ -102,7 +102,7 @@ func (fd FeeDecorator) checkDeductFee(ctx sdk.Context, feeTx sdk.FeeTx, taxes sd
return err
}

if !taxes.IsZero() {
if !taxes.IsZero() && !simulate {
err := fd.BurnTaxSplit(ctx, taxes)
if err != nil {
return err
Expand Down

0 comments on commit f75ef44

Please sign in to comment.