Skip to content

Commit

Permalink
ensure accountKeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
kkast committed May 30, 2024
1 parent 46975cd commit c0d820c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom/staking/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Keeper struct {
authority string
mintKeeper mintkeeper.Keeper
distrKeeper distkeeper.Keeper
authKeeper minttypes.AccountKeeper
accountKeeper types.AccountKeeper
}

func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]abcicometbft.ValidatorUpdate, error) {
Expand Down Expand Up @@ -142,6 +142,7 @@ func NewKeeper(
cdc: cdc,
mintKeeper: mintkeeper.Keeper{},
distrKeeper: distkeeper.Keeper{},
accountKeeper: ak,
}
return &keeper
}
Expand Down Expand Up @@ -172,7 +173,7 @@ func (k Keeper) SlashWithInfractionReason(ctx context.Context, consAddr sdk.Cons
if err != nil {
k.Logger(ctx).Error("Failed to mint slashed coins: ", amountBurned)
} else {
err = k.distrKeeper.FundCommunityPool(ctx, coins, k.authKeeper.GetModuleAddress(minttypes.ModuleName))
err = k.distrKeeper.FundCommunityPool(ctx, coins, k.accountKeeper.GetModuleAddress(minttypes.ModuleName))
if err != nil {
k.Logger(ctx).Error(fmt.Sprintf("Failed to fund community pool. Tokens minted to the staking module account: %d. ", amountBurned))
} else {
Expand Down

0 comments on commit c0d820c

Please sign in to comment.