/
expected_keeper.go
53 lines (46 loc) · 2.16 KB
/
expected_keeper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package types
import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types"
)
// StakingKeeper defines the expected interface contract defined by the x/staking
// module.
type StakingKeeper interface {
Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI
GetBondedValidatorsByPower(ctx sdk.Context) []sdkstaking.Validator
TotalBondedTokens(sdk.Context) math.Int
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) math.Int
Jail(sdk.Context, sdk.ConsAddress)
ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
MaxValidators(sdk.Context) uint32
PowerReduction(ctx sdk.Context) (res math.Int)
}
// DistributionKeeper defines the expected interface contract defined by the
// x/distribution module.
type DistributionKeeper interface {
AllocateTokensToValidator(ctx sdk.Context, val sdkstaking.ValidatorI, tokens sdk.DecCoins)
GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins
}
// AccountKeeper defines the expected interface contract defined by the x/auth
// module.
type AccountKeeper interface {
GetModuleAddress(name string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
// only used for simulation
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
}
// BankKeeper defines the expected interface contract defined by the x/bank
// module.
type BankKeeper interface {
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
// only used for simulation
SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}