-
Notifications
You must be signed in to change notification settings - Fork 557
/
expected_keepers.go
112 lines (86 loc) · 4.41 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
package types
import (
"time"
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"
"github.com/osmosis-labs/osmosis/osmomath"
cltypes "github.com/osmosis-labs/osmosis/v21/x/concentrated-liquidity/types"
incentivestypes "github.com/osmosis-labs/osmosis/v21/x/incentives/types"
"github.com/osmosis-labs/osmosis/v21/x/pool-incentives/types"
poolmanagertypes "github.com/osmosis-labs/osmosis/v21/x/poolmanager/types"
epochtypes "github.com/osmosis-labs/osmosis/x/epochs/types"
)
// AccountKeeper defines the account contract that must be fulfilled when
// creating a x/gamm keeper.
type AccountKeeper interface {
NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
SetAccount(ctx sdk.Context, acc authtypes.AccountI)
GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
}
// BankKeeper defines the banking contract that must be fulfilled when
// creating a x/gamm keeper.
type BankKeeper interface {
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
SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
// Only needed for simulation interface matching
// TODO: Look into golang syntax to make this "Everything in stakingtypes.bankkeeper + extra funcs"
// I think it has to do with listing another interface as the first line here?
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}
// CommunityPoolKeeper defines the contract needed to be fulfilled for distribution keeper.
type CommunityPoolKeeper interface {
FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
}
// ConcentratedLiquidityKeeper defines the contract needed to be fulfilled for the concentrated liquidity keeper.
type ConcentratedLiquidityKeeper interface {
SetParams(ctx sdk.Context, params cltypes.Params)
GetConcentratedPoolById(ctx sdk.Context, poolId uint64) (cltypes.ConcentratedPoolExtension, error)
CreateFullRangePosition(ctx sdk.Context, clPoolId uint64, owner sdk.AccAddress, coins sdk.Coins) (positionData cltypes.CreateFullRangePositionData, err error)
}
// PoolManager defines the interface needed to be fulfilled for
// the pool manger.
type PoolManager interface {
CreatePool(ctx sdk.Context, msg poolmanagertypes.CreatePoolMsg) (uint64, error)
GetNextPoolId(ctx sdk.Context) uint64
RouteExactAmountIn(
ctx sdk.Context,
sender sdk.AccAddress,
routes []poolmanagertypes.SwapAmountInRoute,
tokenIn sdk.Coin,
tokenOutMinAmount osmomath.Int) (tokenOutAmount osmomath.Int, err error)
RouteExactAmountOut(ctx sdk.Context,
sender sdk.AccAddress,
routes []poolmanagertypes.SwapAmountOutRoute,
tokenInMaxAmount osmomath.Int,
tokenOut sdk.Coin,
) (tokenInAmount osmomath.Int, err error)
MultihopEstimateOutGivenExactAmountIn(
ctx sdk.Context,
routes []poolmanagertypes.SwapAmountInRoute,
tokenIn sdk.Coin,
) (tokenOutAmount osmomath.Int, err error)
MultihopEstimateInGivenExactAmountOut(
ctx sdk.Context,
routes []poolmanagertypes.SwapAmountOutRoute,
tokenOut sdk.Coin) (tokenInAmount osmomath.Int, err error)
GetPoolModule(ctx sdk.Context, poolId uint64) (poolmanagertypes.PoolModuleI, error)
GetPool(ctx sdk.Context, poolId uint64) (poolmanagertypes.PoolI, error)
CreateConcentratedPoolAsPoolManager(ctx sdk.Context, msg poolmanagertypes.CreatePoolMsg) (poolmanagertypes.PoolI, error)
GetTradingPairTakerFee(ctx sdk.Context, denom0, denom1 string) (osmomath.Dec, error)
}
type PoolIncentivesKeeper interface {
GetGaugesForCFMMPool(ctx sdk.Context, poolId uint64) ([]incentivestypes.Gauge, error)
GetPoolGaugeId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration) (uint64, error)
GetDistrInfo(ctx sdk.Context) types.DistrInfo
SetDistrInfo(ctx sdk.Context, distrInfo types.DistrInfo)
}
type IncentivesKeeper interface {
GetEpochInfo(ctx sdk.Context) epochtypes.EpochInfo
}