Documentation
¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type BondID
- type Keeper
- func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddress) (*types.Bond, error)
- func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
- func (k Keeper) DeleteBond(ctx sdk.Context, bond types.Bond)
- func (k Keeper) GetBond(ctx sdk.Context, id string) types.Bond
- func (k Keeper) GetBondModuleBalances(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetMaxBondAmount(ctx sdk.Context) (res sdk.Coin)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HasBond(ctx sdk.Context, id string) bool
- func (k Keeper) ListBonds(ctx sdk.Context) []*types.Bond
- func (k Keeper) MatchBonds(ctx sdk.Context, matchFn func(*types.Bond) bool) []*types.Bond
- func (k Keeper) QueryBondsByOwner(ctx sdk.Context, ownerAddress string) []types.Bond
- func (k Keeper) RefillBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
- func (k Keeper) SaveBond(ctx sdk.Context, bond *types.Bond)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id, moduleAccount string, coins sdk.Coins) error
- func (k Keeper) WithdrawBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
- type Querier
- func (q Querier) Bonds(c context.Context, _ *types.QueryGetBondsRequest) (*types.QueryGetBondsResponse, error)
- func (q Querier) GetBondByID(c context.Context, req *types.QueryGetBondByIDRequest) (*types.QueryGetBondByIDResponse, error)
- func (q Querier) GetBondsByOwner(c context.Context, req *types.QueryGetBondsByOwnerRequest) (*types.QueryGetBondsByOwnerResponse, error)
- func (q Querier) GetBondsModuleBalance(c context.Context, _ *types.QueryGetBondModuleBalanceRequest) (*types.QueryGetBondModuleBalanceResponse, error)
- func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the bonds module.
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the 'bond' module account balance is non-negative.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bond MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all bond invariants
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, usageKeepers []types.BondUsageKeeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace, ) Keeper
NewKeeper creates new instances of the bond Keeper
func (Keeper) CancelBond ¶
func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddress) (*types.Bond, error)
CancelBond cancels a bond, returning funds to the owner.
func (Keeper) CreateBond ¶
func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
CreateBond creates a new bond.
func (Keeper) DeleteBond ¶
DeleteBond - deletes the bond.
func (Keeper) GetBondModuleBalances ¶
GetBondModuleBalances gets the bond module account(s) balances.
func (Keeper) GetMaxBondAmount ¶
GetMaxBondAmount max bond amount
func (Keeper) MatchBonds ¶
MatchBonds - get all matching bonds.
func (Keeper) QueryBondsByOwner ¶
QueryBondsByOwner - query bonds by owner.
func (Keeper) RefillBond ¶
func (k Keeper) RefillBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
RefillBond refills an existing bond.
type Querier ¶
type Querier struct {
Keeper
}
func (Querier) Bonds ¶
func (q Querier) Bonds(c context.Context, _ *types.QueryGetBondsRequest) (*types.QueryGetBondsResponse, error)
func (Querier) GetBondByID ¶
func (q Querier) GetBondByID(c context.Context, req *types.QueryGetBondByIDRequest) (*types.QueryGetBondByIDResponse, error)
func (Querier) GetBondsByOwner ¶
func (q Querier) GetBondsByOwner(c context.Context, req *types.QueryGetBondsByOwnerRequest) (*types.QueryGetBondsByOwnerResponse, error)
func (Querier) GetBondsModuleBalance ¶
func (q Querier) GetBondsModuleBalance(c context.Context, _ *types.QueryGetBondModuleBalanceRequest, ) (*types.QueryGetBondModuleBalanceResponse, error)
func (Querier) Params ¶
func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)