Documentation ¶
Index ¶
- Constants
- func NewQuerier(k Keeper) sdk.Querier
- func NonnegativeBalanceInvariant(ak types.AccountKeeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, ak types.AccountKeeper)
- type BaseKeeper
- type BaseSendKeeper
- func (keeper BaseSendKeeper) AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
- func (keeper BaseSendKeeper) GetSendEnabled(ctx sdk.Context) bool
- func (keeper BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) sdk.Error
- func (keeper BaseSendKeeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper BaseSendKeeper) SetCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper BaseSendKeeper) SetSendEnabled(ctx sdk.Context, enabled bool)
- func (keeper BaseSendKeeper) SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
- type BaseViewKeeper
- func (keeper BaseViewKeeper) Codespace() sdk.CodespaceType
- func (keeper BaseViewKeeper) GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
- func (keeper BaseViewKeeper) HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) bool
- func (keeper BaseViewKeeper) Logger(ctx sdk.Context) log.Logger
- type Keeper
- type SendKeeper
- type ViewKeeper
Constants ¶
const (
// query balance path
QueryBalance = "balances"
)
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier returns a new sdk.Keeper instance.
func NonnegativeBalanceInvariant ¶
func NonnegativeBalanceInvariant(ak types.AccountKeeper) sdk.Invariant
NonnegativeBalanceInvariant checks that all accounts in the application have non-negative balances
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, ak types.AccountKeeper)
register bank invariants
Types ¶
type BaseKeeper ¶
type BaseKeeper struct { BaseSendKeeper // contains filtered or unexported fields }
BaseKeeper manages transfers between accounts. It implements the Keeper interface.
func NewBaseKeeper ¶
func NewBaseKeeper(ak types.AccountKeeper, paramSpace params.Subspace, codespace sdk.CodespaceType) BaseKeeper
NewBaseKeeper returns a new BaseKeeper
func (BaseKeeper) DelegateCoins ¶
func (keeper BaseKeeper) DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
DelegateCoins performs delegation by deducting amt coins from an account with address addr. For vesting accounts, delegations amounts are tracked for both vesting and vested coins. The coins are then transferred from the delegator address to a ModuleAccount address. If any of the delegation amounts are negative, an error is returned.
func (BaseKeeper) UndelegateCoins ¶
func (keeper BaseKeeper) UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
UndelegateCoins performs undelegation by crediting amt coins to an account with address addr. For vesting accounts, undelegation amounts are tracked for both vesting and vested coins. The coins are then transferred from a ModuleAccount address to the delegator address. If any of the undelegation amounts are negative, an error is returned.
type BaseSendKeeper ¶
type BaseSendKeeper struct { BaseViewKeeper // contains filtered or unexported fields }
BaseSendKeeper only allows transfers between accounts without the possibility of creating coins. It implements the SendKeeper interface.
func NewBaseSendKeeper ¶
func NewBaseSendKeeper(ak types.AccountKeeper, paramSpace params.Subspace, codespace sdk.CodespaceType) BaseSendKeeper
NewBaseSendKeeper returns a new BaseSendKeeper.
func (BaseSendKeeper) AddCoins ¶
func (keeper BaseSendKeeper) AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
AddCoins adds amt to the coins at the addr.
func (BaseSendKeeper) GetSendEnabled ¶
func (keeper BaseSendKeeper) GetSendEnabled(ctx sdk.Context) bool
GetSendEnabled returns the current SendEnabled nolint: errcheck
func (BaseSendKeeper) InputOutputCoins ¶
func (keeper BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) sdk.Error
InputOutputCoins handles a list of inputs and outputs
func (BaseSendKeeper) SendCoins ¶
func (keeper BaseSendKeeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
SendCoins moves coins from one account to another
func (BaseSendKeeper) SetCoins ¶
func (keeper BaseSendKeeper) SetCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
SetCoins sets the coins at the addr.
func (BaseSendKeeper) SetSendEnabled ¶
func (keeper BaseSendKeeper) SetSendEnabled(ctx sdk.Context, enabled bool)
SetSendEnabled sets the send enabled
func (BaseSendKeeper) SubtractCoins ¶
func (keeper BaseSendKeeper) SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
SubtractCoins subtracts amt from the coins at the addr.
CONTRACT: If the account is a vesting account, the amount has to be spendable.
type BaseViewKeeper ¶
type BaseViewKeeper struct {
// contains filtered or unexported fields
}
BaseViewKeeper implements a read only keeper implementation of ViewKeeper.
func NewBaseViewKeeper ¶
func NewBaseViewKeeper(ak types.AccountKeeper, codespace sdk.CodespaceType) BaseViewKeeper
NewBaseViewKeeper returns a new BaseViewKeeper.
func (BaseViewKeeper) Codespace ¶
func (keeper BaseViewKeeper) Codespace() sdk.CodespaceType
Codespace returns the keeper's codespace.
func (BaseViewKeeper) GetCoins ¶
func (keeper BaseViewKeeper) GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
GetCoins returns the coins at the addr.
func (BaseViewKeeper) HasCoins ¶
func (keeper BaseViewKeeper) HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) bool
HasCoins returns whether or not an account has at least amt coins.
type Keeper ¶
type Keeper interface { SendKeeper DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) sdk.Error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) sdk.Error }
Keeper defines a module interface that facilitates the transfer of coins between accounts.
type SendKeeper ¶
type SendKeeper interface { ViewKeeper InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) sdk.Error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) sdk.Error SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error) AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error) SetCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error GetSendEnabled(ctx sdk.Context) bool SetSendEnabled(ctx sdk.Context, enabled bool) }
SendKeeper defines a module interface that facilitates the transfer of coins between accounts without the possibility of creating coins.
type ViewKeeper ¶
type ViewKeeper interface { GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) bool Codespace() sdk.CodespaceType }
ViewKeeper defines a module interface that facilitates read only access to account balances.