Skip to content

Commit

Permalink
rename authKeeper to accountKeeper; ensure accountKeeper is set on Ne…
Browse files Browse the repository at this point in the history
…wKeeper instantiation to avoid panic; fixes ComposableFi#526
  • Loading branch information
joe-bowman committed May 30, 2024
1 parent 69a6072 commit 636bd0b
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 636bd0b

Please sign in to comment.