github.com/InjectiveLabs/sdk-go@v1.53.0/chain/peggy/types/expected_keepers.go (about)

     1  package types
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"cosmossdk.io/math"
     8  	storetypes "cosmossdk.io/store/types"
     9  	sdk "github.com/cosmos/cosmos-sdk/types"
    10  	bank "github.com/cosmos/cosmos-sdk/x/bank/types"
    11  	"github.com/cosmos/cosmos-sdk/x/distribution/types"
    12  	slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
    13  	stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
    14  )
    15  
    16  // StakingKeeper defines the expected staking keeper methods
    17  type StakingKeeper interface {
    18  	GetBondedValidatorsByPower(ctx context.Context) ([]stakingtypes.Validator, error)
    19  	GetLastValidatorPower(ctx context.Context, operator sdk.ValAddress) (int64, error)
    20  	GetLastTotalPower(ctx context.Context) (power math.Int, err error)
    21  	IterateValidators(context.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error
    22  	ValidatorQueueIterator(ctx context.Context, endTime time.Time, endHeight int64) (storetypes.Iterator, error)
    23  	GetParams(ctx context.Context) (stakingtypes.Params, error)
    24  	GetValidator(ctx context.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, err error)
    25  	IterateBondedValidatorsByPower(context.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error
    26  	IterateLastValidators(context.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error
    27  	Validator(context.Context, sdk.ValAddress) (stakingtypes.ValidatorI, error)
    28  	ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error)
    29  	Slash(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) (math.Int, error)
    30  	Jail(context.Context, sdk.ConsAddress) error
    31  	PowerReduction(ctx context.Context) (res math.Int)
    32  }
    33  
    34  // BankKeeper defines the expected bank keeper methods
    35  type BankKeeper interface {
    36  	SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
    37  	SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
    38  	SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
    39  	MintCoins(ctx context.Context, name string, amt sdk.Coins) error
    40  	BurnCoins(ctx context.Context, name string, amt sdk.Coins) error
    41  	GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
    42  	GetDenomMetaData(ctx context.Context, denom string) (bank.Metadata, bool)
    43  	GetSupply(ctx context.Context, denom string) sdk.Coin
    44  }
    45  
    46  type SlashingKeeper interface {
    47  	GetValidatorSigningInfo(ctx context.Context, address sdk.ConsAddress) (info slashingtypes.ValidatorSigningInfo, err error)
    48  }
    49  
    50  type DistributionKeeper interface {
    51  	FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
    52  	GetFeePool(ctx context.Context) (feePool types.FeePool)
    53  	SetFeePool(ctx context.Context, feePool types.FeePool)
    54  }