-
Notifications
You must be signed in to change notification settings - Fork 182
/
expected_keepers.go
48 lines (41 loc) · 1.84 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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/okex/exchain/x/params"
token "github.com/okex/exchain/x/token/types"
)
// ParamSubspace defines the expected Subspace interface
type ParamSubspace interface {
WithKeyTable(table params.KeyTable) params.Subspace
Get(ctx sdk.Context, key []byte, ptr interface{})
GetParamSet(ctx sdk.Context, ps params.ParamSet)
SetParamSet(ctx sdk.Context, ps params.ParamSet)
}
// BankKeeper defines the expected bank interface
type BankKeeper interface {
SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error)
SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
}
// SupplyKeeper defines the expected supply interface
type SupplyKeeper interface {
GetSupplyByDenom(ctx sdk.Context, denom string) sdk.Dec
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string,
recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress,
recipientModule string, amt sdk.Coins) sdk.Error
MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error
BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error
}
// TokenKeeper defines the expected token interface
type TokenKeeper interface {
GetTokenInfo(ctx sdk.Context, symbol string) token.Token
NewToken(ctx sdk.Context, token token.Token)
UpdateToken(ctx sdk.Context, token token.Token)
GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.SysCoins
TokenExist(ctx sdk.Context, symbol string) bool
GetTokensInfo(ctx sdk.Context) (tokens []token.Token)
}
type BackendKeeper interface {
OnSwapToken(ctx sdk.Context, address sdk.AccAddress, swapTokenPair SwapTokenPair, sellAmount sdk.SysCoin, buyAmount sdk.SysCoin)
OnSwapCreateExchange(ctx sdk.Context, swapTokenPair SwapTokenPair)
}