Documentation ¶
Index ¶
- Constants
- func AllInvariants(k Keeper) sdk.Invariant
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type BondClientKeeper
- type Keeper
- func (k Keeper) CancelBond(ctx sdk.Context, id types.ID, 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 types.ID) types.Bond
- func (k Keeper) GetBondModuleBalances(ctx sdk.Context) map[string]sdk.Coins
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HasBond(ctx sdk.Context, id types.ID) 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 types.ID, 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) TranserCoinsToAccount(ctx sdk.Context, id types.ID, account sdk.AccAddress, coins sdk.Coins) error
- func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id types.ID, moduleAccount string, coins sdk.Coins) error
- func (k Keeper) WithdrawBond(ctx sdk.Context, id types.ID, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
Constants ¶
const ( ListBonds = "list" GetBond = "get" QueryByOwner = "query-by-owner" QueryParameters = "parameters" Balance = "balance" )
query endpoints supported by the bond Querier
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 NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all bond module invariants.
Types ¶
type BondClientKeeper ¶
type BondClientKeeper interface { HasBond(ctx sdk.Context, id types.ID) bool GetBond(ctx sdk.Context, id types.ID) types.Bond MatchBonds(ctx sdk.Context, matchFn func(*types.Bond) bool) []*types.Bond TransferCoinsToModuleAccount(ctx sdk.Context, id types.ID, moduleAccount string, coins sdk.Coins) error TranserCoinsToAccount(ctx sdk.Context, id types.ID, account sdk.AccAddress, coins sdk.Coins) error }
BondClientKeeper is the subset of functionality exposed to other modules.
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(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, supplyKeeper supply.Keeper, usageKeepers []types.BondUsageKeeper, storeKey sdk.StoreKey, cdc *codec.Codec, paramstore params.Subspace) Keeper
NewKeeper creates new instances of the bond Keeper
func (Keeper) CancelBond ¶
func (k Keeper) CancelBond(ctx sdk.Context, id types.ID, 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) 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 types.ID, ownerAddress sdk.AccAddress, coins sdk.Coins) (*types.Bond, error)
RefillBond refills an existing bond.
func (Keeper) TranserCoinsToAccount ¶
func (k Keeper) TranserCoinsToAccount(ctx sdk.Context, id types.ID, account sdk.AccAddress, coins sdk.Coins) error
TranserCoinsToAccount moves coins from the bond to an account.