Skip to content

Commit

Permalink
add SetTotalBurnedNeutronsAmount method to feeburner
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 authored and pr0n00gler committed Aug 21, 2024
1 parent 1575c17 commit ac620c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/feeburner/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// InitGenesis initializes the module's state from a provided genesis state.
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) {
// this line is used by starport scaffolding # genesis/module/init
k.RecordBurnedFees(ctx, genState.TotalBurnedNeutronsAmount.Coin)
k.SetTotalBurnedNeutronsAmount(ctx, genState.TotalBurnedNeutronsAmount)

err := k.SetParams(ctx, genState.Params)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions x/feeburner/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ func (k Keeper) GetTotalBurnedNeutronsAmount(ctx sdk.Context) types.TotalBurnedN
return totalBurnedNeutronsAmount
}

// SetTotalBurnedNeutronsAmount sets the total burned amount of NTRN tokens
func (k Keeper) SetTotalBurnedNeutronsAmount(ctx sdk.Context, totalBurnedNeutronsAmount types.TotalBurnedNeutronsAmount) {
store := ctx.KVStore(k.storeKey)

store.Set(KeyBurnedFees, k.cdc.MustMarshal(&totalBurnedNeutronsAmount))
}

// BurnAndDistribute is an important part of tokenomics. It does few things:
// 1. Burns NTRN fee coins distributed to consumertypes.ConsumerRedistributeName in ICS (https://github.com/cosmos/interchain-security/blob/86046926502f7b0ba795bebcdd1fdc97ac776573/x/ccv/consumer/keeper/distribution.go#L67)
// 2. Updates total amount of burned NTRN coins
Expand Down

0 comments on commit ac620c1

Please sign in to comment.