diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index b3a95d7d..65878407 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -210,7 +210,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appCodec, appKeepers.keys[distrtypes.StoreKey], appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - appKeepers.StakingKeeper.RegisterKeepers(appKeepers.DistrKeeper, appKeepers.BankKeeper) + appKeepers.StakingKeeper.RegisterKeepers(appKeepers.DistrKeeper, appKeepers.MintKeeper) appKeepers.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, cdc, appKeepers.keys[slashingtypes.StoreKey], appKeepers.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) diff --git a/custom/staking/keeper/keeper.go b/custom/staking/keeper/keeper.go index 7549e8fa..4f9fde1f 100644 --- a/custom/staking/keeper/keeper.go +++ b/custom/staking/keeper/keeper.go @@ -12,6 +12,7 @@ import ( distkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + mintkeeper "github.com/notional-labs/composable/v6/x/mint/keeper" minttypes "github.com/notional-labs/composable/v6/x/mint/types" stakingmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/keeper" ) @@ -21,7 +22,7 @@ type Keeper struct { cdc codec.BinaryCodec Stakingmiddleware *stakingmiddleware.Keeper authority string - mintKeeper minttypes.BankKeeper + mintKeeper mintkeeper.Keeper distrKeeper distkeeper.Keeper authKeeper minttypes.AccountKeeper } @@ -125,14 +126,14 @@ func NewKeeper( authority: authority, Stakingmiddleware: stakingmiddleware, cdc: cdc, - mintKeeper: nil, + mintKeeper: mintkeeper.Keeper{}, distrKeeper: distkeeper.Keeper{}, authKeeper: ak, } return &keeper } -func (k *Keeper) RegisterKeepers(dk distkeeper.Keeper, mk minttypes.BankKeeper) { +func (k *Keeper) RegisterKeepers(dk distkeeper.Keeper, mk mintkeeper.Keeper) { k.distrKeeper = dk k.mintKeeper = mk } @@ -143,11 +144,11 @@ func (k Keeper) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddr amountBurned := k.Slash(ctx, consAddr, infractionHeight, power, slashFactor) // after usual slashing and burning is done, mint burned coinds into community pool coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), amountBurned)) - err := k.mintKeeper.MintCoins(ctx, types.ModuleName, coins) + err := k.mintKeeper.MintCoins(ctx, coins) if err != nil { k.Logger(ctx).Error("Failed to mint slashed coins: ", amountBurned) } else { - err = k.distrKeeper.FundCommunityPool(ctx, coins, k.authKeeper.GetModuleAddress(types.ModuleName)) + err = k.distrKeeper.FundCommunityPool(ctx, coins, k.authKeeper.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 {