Skip to content

Commit

Permalink
make burnparam sdk.Int
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 4, 2022
1 parent 2f549d2 commit 66cf1c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
moduleAcc.Permissions = []string{authtypes.Burner}
app.AccountKeeper.SetModuleAccount(ctx, moduleAcc)

burnPercent := uint64(50)
burnPercent := sdk.NewInt(50)

// Set TxFeeBurnPercent to 50%
params1 := authtypes.NewParams(
Expand Down
16 changes: 8 additions & 8 deletions app/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ type BankKeeper interface {
// Call next AnteHandler if fees successfully deducted
// CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator
type DeductFeeDecorator struct {
ak AccountKeeper
bankKeeper BankKeeper
feegrantKeeper FeegrantKeeper
ak AccountKeeper
bankKeeper BankKeeper
feegrantKeeper FeegrantKeeper
}

func NewDeductFeeDecorator(ak AccountKeeper, bk BankKeeper, fk FeegrantKeeper) DeductFeeDecorator {
return DeductFeeDecorator{
ak: ak,
bankKeeper: bk,
feegrantKeeper: fk,
ak: ak,
bankKeeper: bk,
feegrantKeeper: fk,
}
}

Expand Down Expand Up @@ -84,7 +84,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo

// deduct the fees
if !feeTx.GetFee().IsZero() {
err = DeductFees(dfd.bankKeeper, ctx, deductFeesFromAcc, feeTx.GetFee(), sdk.NewInt(int64(dfd.ak.GetParams(ctx).TxFeeBurnPercent)))
err = DeductFees(dfd.bankKeeper, ctx, deductFeesFromAcc, feeTx.GetFee(), dfd.ak.TxFeeBurnPercent(ctx))
if err != nil {
return ctx, err
}
Expand Down Expand Up @@ -122,4 +122,4 @@ func DeductFees(bankKeeper BankKeeper, ctx sdk.Context, acc types.AccountI, fees
}

return nil
}
}

0 comments on commit 66cf1c1

Please sign in to comment.