/
expected_keepers.go
117 lines (101 loc) · 5.22 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package types
import (
"context"
sdk "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types"
"github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/auth"
capabilitytypes "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/capability/types"
"github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/distribution/types"
"github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/params"
stakingtypes "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/staking/types"
connectiontypes "github.com/furyaxyz/fuxchain/libs/ibc-go/modules/core/03-connection/types"
channeltypes "github.com/furyaxyz/fuxchain/libs/ibc-go/modules/core/04-channel/types"
ibcexported "github.com/furyaxyz/fuxchain/libs/ibc-go/modules/core/exported"
ptypes "github.com/furyaxyz/fuxchain/x/params/types"
)
// BankViewKeeper defines a subset of methods implemented by the cosmos-sdk bank keeper
type BankViewKeeper interface {
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}
// BankKeeper defines a subset of methods implemented by the cosmos-sdk bank keeper
type BankKeeper interface {
BankViewKeeper
// Burner
IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error
BlockedAddr(addr sdk.AccAddress) bool
SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
GetSendEnabled(ctx sdk.Context) bool
}
// AccountKeeper defines a subset of methods implemented by the cosmos-sdk account keeper
type AccountKeeper interface {
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.Account
// Retrieve an account from the store.
GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
// Set an account in the store.
SetAccount(ctx sdk.Context, acc auth.Account)
// SetObserverKeeper sets an observer for listening changes of any accounts.
SetObserverKeeper(observer auth.ObserverI)
}
// DistributionKeeper defines a subset of methods implemented by the cosmos-sdk distribution keeper
type DistributionKeeper interface {
DelegationRewards(c context.Context, req *types.QueryDelegationRewardsParams) (*sdk.DecCoins, error)
}
// StakingKeeper defines a subset of methods implemented by the cosmos-sdk staking keeper
type StakingKeeper interface {
// BondDenom - Bondable coin denomination
BondDenom(ctx sdk.Context) (res string)
// GetValidator get a single validator
GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
// GetBondedValidatorsByPower get the current group of bonded validators sorted by power-rank
GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
// GetAllDelegatorDelegations return all delegations for a delegator
GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation
// GetDelegation return a specific delegation
GetDelegation(ctx sdk.Context,
delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool)
// HasReceivingRedelegation check if validator is receiving a redelegation
HasReceivingRedelegation(ctx sdk.Context,
delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
}
// ChannelKeeper defines the expected IBC channel keeper
type ChannelKeeper interface {
GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
GetAllChannels(ctx sdk.Context) (channels []channeltypes.IdentifiedChannel)
IterateChannels(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool)
SetChannel(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel)
}
// ClientKeeper defines the expected IBC client keeper
type ClientKeeper interface {
GetClientConsensusState(ctx sdk.Context, clientID string) (connection ibcexported.ConsensusState, found bool)
}
// ConnectionKeeper defines the expected IBC connection keeper
type ConnectionKeeper interface {
GetConnection(ctx sdk.Context, connectionID string) (connection connectiontypes.ConnectionEnd, found bool)
}
// PortKeeper defines the expected IBC port keeper
type PortKeeper interface {
BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}
type CapabilityKeeper interface {
GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool)
ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
AuthenticateCapability(ctx sdk.Context, capability *capabilitytypes.Capability, name string) bool
}
// ICS20TransferPortSource is a subset of the ibc transfer keeper.
type ICS20TransferPortSource interface {
GetPort(ctx sdk.Context) string
}
type Subspace interface {
GetParamSet(ctx sdk.Context, ps params.ParamSet)
SetParamSet(ctx sdk.Context, ps params.ParamSet)
}
type DBAdapter interface {
NewStore(gasMeter sdk.GasMeter, parent sdk.KVStore, prefix []byte) sdk.KVStore
}
type ParamsKeeper interface {
ClaimReadyForUpgrade(name string, cb func(ptypes.UpgradeInfo))
}