Skip to content

Commit

Permalink
ensure accountKeeper (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkast committed May 30, 2024
1 parent 59559a8 commit 99ba1dc
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 99ba1dc

Please sign in to comment.