/
expected_keepers.go
46 lines (38 loc) · 1.85 KB
/
expected_keepers.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
package types
import (
sdk "github.com/DFWallet/anatha/types"
authexported "github.com/DFWallet/anatha/x/auth/exported"
stakingexported "github.com/DFWallet/anatha/x/staking/exported"
supplyexported "github.com/DFWallet/anatha/x/supply/exported"
)
// ParamSubspace defines the expected Subspace interface for parameters (noalias)
type ParamSubspace interface {
Get(ctx sdk.Context, key []byte, ptr interface{})
Set(ctx sdk.Context, key []byte, param interface{})
}
// SupplyKeeper defines the expected supply keeper for module accounts (noalias)
type SupplyKeeper interface {
GetModuleAddress(name string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI
// TODO remove with genesis 2-phases refactor https://github.com/DFWallet/anatha/issues/2862
SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI)
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
}
// StakingKeeper expected staking keeper (Validator and Delegator sets) (noalias)
type StakingKeeper interface {
// iterate through bonded validators by operator address, execute func for each validator
IterateBondedValidatorsByPower(
sdk.Context, func(index int64, validator stakingexported.ValidatorI) (stop bool),
)
TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set
IterateDelegations(
ctx sdk.Context, delegator sdk.AccAddress,
fn func(index int64, delegation stakingexported.DelegationI) (stop bool),
)
}
// AccountKeeper defines the expected account keeper (noalias)
type AccountKeeper interface {
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}