Skip to content

Commit

Permalink
- add burned event to emitted events
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Nov 19, 2023
1 parent 3cdf8bb commit d18338b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions x/classictax/keeper/taxsplit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/types"

classictax "github.com/classic-terra/core/v2/x/classictax/types"
treasury "github.com/classic-terra/core/v2/x/treasury/types"
)

Expand Down Expand Up @@ -33,6 +34,15 @@ func (k Keeper) BurnTaxSplit(ctx sdk.Context, taxes sdk.Coins) (err error) {
); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
}

// emit event
events := sdk.Events{
sdk.NewEvent(
sdk.EventTypeTx,
sdk.NewAttribute(classictax.AttributeKeyBurned, taxes.String()),
),
}
ctx.EventManager().EmitEvents(events)
}

return nil
Expand Down
3 changes: 2 additions & 1 deletion x/classictax/types/events.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package types

const (
AttributeKeyTax = "tax"
AttributeKeyTax = "tax"
AttributeKeyBurned = "burned"
)

0 comments on commit d18338b

Please sign in to comment.