Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func DepositsInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQueryServerImpl(k Keeper) types.QueryServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SolvencyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AfterSavingsDepositCreated(ctx sdk.Context, deposit types.Deposit)
- func (k Keeper) BeforeSavingsDepositModified(ctx sdk.Context, deposit types.Deposit, incomingDenoms []string)
- func (k Keeper) CalculateWithdrawAmount(available sdk.Coins, request sdk.Coins) (sdk.Coins, error)
- func (k Keeper) DeleteDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k Keeper) Deposit(ctx sdk.Context, depositor sdk.AccAddress, coins sdk.Coins) error
- func (k Keeper) GetAllDeposits(ctx sdk.Context) (deposits types.Deposits)
- func (k Keeper) GetDeposit(ctx sdk.Context, depositor sdk.AccAddress) (types.Deposit, bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetSavingsModuleAccountBalances(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetTotalDeposited(ctx sdk.Context, depositDenom string) (total sdkmath.Int)
- func (k Keeper) IsDenomSupported(ctx sdk.Context, denom string) bool
- func (k Keeper) IterateDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k *Keeper) SetHooks(hooks types.MultiSavingsHooks) *Keeper
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) ValidateDeposit(ctx sdk.Context, coins sdk.Coins) error
- func (k Keeper) Withdraw(ctx sdk.Context, depositor sdk.AccAddress, coins sdk.Coins) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the savings module
func DepositsInvariant ¶
DepositsInvariant iterates all deposits and asserts that they are valid
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the savings MsgServer interface for the provided Keeper.
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) types.QueryServer
NewQueryServerImpl creates a new server for handling gRPC queries.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the savings module invariants
func SolvencyInvariant ¶
SolvencyInvariant iterates all deposits and ensures the total amount matches the module account coins
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper struct for savings module
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, paramstore paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, lk types.LiquidKeeper, ) Keeper
NewKeeper returns a new keeper for the savings module.
func (Keeper) AfterSavingsDepositCreated ¶
AfterSavingsDepositCreated - call hook if registered
func (Keeper) BeforeSavingsDepositModified ¶
func (k Keeper) BeforeSavingsDepositModified(ctx sdk.Context, deposit types.Deposit, incomingDenoms []string)
BeforeSavingsDepositModified - call hook if registered
func (Keeper) CalculateWithdrawAmount ¶
CalculateWithdrawAmount enables full withdraw of deposited coins by adjusting withdraw amount to equal total deposit amount if the requested withdraw amount > current deposit amount
func (Keeper) DeleteDeposit ¶
DeleteDeposit deletes a deposit from the store
func (Keeper) GetAllDeposits ¶
GetAllDeposits returns all Deposits from the store
func (Keeper) GetDeposit ¶
GetDeposit returns a deposit from the store for a particular depositor address, deposit denom
func (Keeper) GetSavingsModuleAccountBalances ¶
GetSavingsModuleAccountBalances returns the savings module account balances
func (Keeper) GetTotalDeposited ¶
GetTotalDeposited returns the total amount deposited for the deposit denom
func (Keeper) IsDenomSupported ¶
IsDenomSupported returns a boolean indicating if a denom is supported
func (Keeper) IterateDeposits ¶
IterateDeposits iterates over all deposit objects in the store and performs a callback function
func (Keeper) SetDeposit ¶
SetDeposit sets the input deposit in the store
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(hooks types.MultiSavingsHooks) *Keeper
SetHooks adds hooks to the keeper.
func (Keeper) ValidateDeposit ¶
ValidateDeposit validates a deposit