-
Notifications
You must be signed in to change notification settings - Fork 364
/
expected_keepers.go
56 lines (48 loc) · 2.59 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
package types // noalias
import (
sdk "github.com/cosmos/cosmos-sdk/types"
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/supply/exported"
pftypes "github.com/kava-labs/kava/x/pricefeed/types"
)
// SupplyKeeper defines the expected supply keeper
type SupplyKeeper interface {
GetModuleAddress(name string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, name string) exported.ModuleAccountI
GetSupply(ctx sdk.Context) (supply exported.SupplyI)
SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}
// AccountKeeper defines the expected keeper interface for interacting with account
type AccountKeeper interface {
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
SetAccount(ctx sdk.Context, acc authexported.Account)
}
// StakingKeeper defines the expected keeper interface for the staking keeper
type StakingKeeper interface {
IterateLastValidators(ctx sdk.Context, fn func(index int64, validator stakingexported.ValidatorI) (stop bool))
IterateValidators(sdk.Context, func(index int64, validator stakingexported.ValidatorI) (stop bool))
IterateAllDelegations(ctx sdk.Context, cb func(delegation stakingtypes.Delegation) (stop bool))
GetBondedPool(ctx sdk.Context) (bondedPool exported.ModuleAccountI)
BondDenom(ctx sdk.Context) (res string)
}
// PricefeedKeeper defines the expected interface for the pricefeed
type PricefeedKeeper interface {
GetCurrentPrice(sdk.Context, string) (pftypes.CurrentPrice, error)
}
// AuctionKeeper expected interface for the auction keeper (noalias)
type AuctionKeeper interface {
StartCollateralAuction(ctx sdk.Context, seller string, lot sdk.Coin, maxBid sdk.Coin, lotReturnAddrs []sdk.AccAddress, lotReturnWeights []sdk.Int, debt sdk.Coin) (uint64, error)
}
// HARDHooks event hooks for other keepers to run code in response to HARD modifications
type HARDHooks interface {
AfterDepositCreated(ctx sdk.Context, deposit Deposit)
BeforeDepositModified(ctx sdk.Context, deposit Deposit)
AfterDepositModified(ctx sdk.Context, deposit Deposit)
AfterBorrowCreated(ctx sdk.Context, borrow Borrow)
BeforeBorrowModified(ctx sdk.Context, borrow Borrow)
AfterBorrowModified(ctx sdk.Context, borrow Borrow)
}