Documentation ¶
Index ¶
- Variables
- func AllInvariants(k Keeper) sdk.Invariant
- func NewQuerier(k Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func TotalSupply(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
- func (k Keeper) DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error
- func (k Keeper) GetAccount(ctx sdk.Context, acc sdk.AccAddress) authtypes.Account
- func (k Keeper) GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI
- func (k Keeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (exported.ModuleAccountI, []string)
- func (k Keeper) GetModuleAddress(moduleName string) sdk.AccAddress
- func (k Keeper) GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
- func (k Keeper) GetSupply(ctx sdk.Context) (supply exported.SupplyI)
- func (k Keeper) GetSupplyByDenom(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
- func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error
- func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
- func (k Keeper) SetModuleAccount(ctx sdk.Context, macc exported.ModuleAccountI)
- func (k Keeper) SetSupply(ctx sdk.Context, supply exported.SupplyI)
- func (k Keeper) UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) ValidatePermissions(macc exported.ModuleAccountI) error
- type SupplyKeerAdapter
- func (k SupplyKeerAdapter) BlockedAddr(address sdk.AccAddress) bool
- func (k SupplyKeerAdapter) HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool
- func (k SupplyKeerAdapter) NewAccount(ctx sdk.Context, acc authtypes.Account) authtypes.Account
- func (k SupplyKeerAdapter) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
- func (k SupplyKeerAdapter) SetAccount(ctx sdk.Context, acc authtypes.Account)
Constants ¶
This section is empty.
Variables ¶
var (
SupplyKey = []byte{0x00}
)
Keys for supply store Items are stored with the following key: values
- 0x00: Supply
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the supply module.
func NewQuerier ¶
NewQuerier creates a querier for supply REST endpoints
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants register all supply invariants
func TotalSupply ¶
TotalSupply checks that the total supply reflects all the coins held in accounts
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the supply store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, maccPerms map[string][]string) Keeper
NewKeeper creates a new Keeper instance
func (Keeper) BurnCoins ¶
BurnCoins burns coins deletes coins from the balance of the module account. It will panic if the module account does not exist or is unauthorized.
func (Keeper) DelegateCoinsFromAccountToModule ¶
func (k Keeper) DelegateCoinsFromAccountToModule( ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error
DelegateCoinsFromAccountToModule delegates coins and transfers them from a delegator account to a module account. It will panic if the module account does not exist or is unauthorized.
func (Keeper) GetAccount ¶
func (Keeper) GetModuleAccount ¶
GetModuleAccount gets the module account from the auth account store
func (Keeper) GetModuleAccountAndPermissions ¶
func (k Keeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (exported.ModuleAccountI, []string)
GetModuleAccountAndPermissions gets the module account from the auth account store and its registered permissions
func (Keeper) GetModuleAddress ¶
func (k Keeper) GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAddress returns an address based on the module name
func (Keeper) GetModuleAddressAndPermissions ¶
func (k Keeper) GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
GetModuleAddressAndPermissions returns an address and permissions based on the module name
func (Keeper) GetSupplyByDenom ¶
GetSupplyByDenom gets the amount of a token supply from the store
func (Keeper) MintCoins ¶
MintCoins creates new coins from thin air and adds it to the module account. It will panic if the module account does not exist or is unauthorized.
func (Keeper) SendCoinsFromAccountToModule ¶
func (k Keeper) SendCoinsFromAccountToModule( ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error
SendCoinsFromAccountToModule transfers coins from an AccAddress to a ModuleAccount. It will panic if the module account does not exist.
func (Keeper) SendCoinsFromModuleToAccount ¶
func (k Keeper) SendCoinsFromModuleToAccount( ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error
SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an AccAddress. It will panic if the module account does not exist.
func (Keeper) SendCoinsFromModuleToModule ¶
func (k Keeper) SendCoinsFromModuleToModule( ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, ) error
SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another. It will panic if either module account does not exist.
func (Keeper) SetModuleAccount ¶
func (k Keeper) SetModuleAccount(ctx sdk.Context, macc exported.ModuleAccountI)
SetModuleAccount sets the module account to the auth account store
func (Keeper) UndelegateCoinsFromModuleToAccount ¶
func (k Keeper) UndelegateCoinsFromModuleToAccount( ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error
UndelegateCoinsFromModuleToAccount undelegates the unbonding coins and transfers them from a module account to the delegator account. It will panic if the module account does not exist or is unauthorized.
func (Keeper) ValidatePermissions ¶
func (k Keeper) ValidatePermissions(macc exported.ModuleAccountI) error
ValidatePermissions validates that the module account has been granted permissions within its set of allowed permissions.
type SupplyKeerAdapter ¶
type SupplyKeerAdapter struct {
Keeper
}
func NewSupplyKeerAdapter ¶
func NewSupplyKeerAdapter(keeper Keeper) *SupplyKeerAdapter
func (SupplyKeerAdapter) BlockedAddr ¶
func (k SupplyKeerAdapter) BlockedAddr(address sdk.AccAddress) bool
func (SupplyKeerAdapter) HasBalance ¶
func (k SupplyKeerAdapter) HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool
func (SupplyKeerAdapter) NewAccount ¶
func (SupplyKeerAdapter) SendCoins ¶
func (k SupplyKeerAdapter) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
func (SupplyKeerAdapter) SetAccount ¶
func (k SupplyKeerAdapter) SetAccount(ctx sdk.Context, acc authtypes.Account)