From b518c84fd4c1197476ea4b096958b508aa9cab1a Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 9 Apr 2022 08:02:23 -0700 Subject: [PATCH] clean up unused methods in distribution expected keepers (#11588) Co-authored-by: Marko Co-authored-by: Aleksandr Bezobchuk --- x/distribution/types/expected_keepers.go | 29 ++---------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 983a1673d..82eee3eab 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -20,8 +20,7 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error @@ -37,45 +36,21 @@ type StakingKeeper interface { IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) - // iterate through bonded validators by operator address, execute func for each validator - IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) - - // iterate through the consensus validator set of the last block by operator address, execute func for each validator - IterateLastValidators(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address - // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction - Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int - Jail(sdk.Context, sdk.ConsAddress) // jail a validator - Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator - // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI - // MaxValidators returns the maximum amount of bonded validators - MaxValidators(sdk.Context) uint32 - IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) - GetLastTotalPower(ctx sdk.Context) sdk.Int - GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 - GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation } // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created - AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted - - BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation is created - BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation's shares are modified + AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) - BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) }