keeper

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCodespace sdk.CodespaceType = types.ModuleName

DefaultCodespace from the supply module

View Source
var (
	SupplyKey = []byte{0x00}
)

Keys for supply store Items are stored with the following key: values

- 0x00: Supply

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the supply module.

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a querier for supply REST endpoints

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants register all supply invariants

func TotalSupply

func TotalSupply(k Keeper) sdk.Invariant

TotalSupply checks that the total supply reflects all the tokens 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) BurnTokens

func (k Keeper) BurnTokens(ctx sdk.Context, moduleName string, amt sdk.Tokens) sdk.Error

BurnTokens burns tokens deletes tokens from the balance of the module account. Panics if the name maps to a non-burner module account or if the amount is invalid.

func (Keeper) DelegateTokensFromAccountToModule

func (k Keeper) DelegateTokensFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress,
	recipientModule string, amt sdk.Tokens) sdk.Error

DelegateTokensFromAccountToModule delegates tokens and transfers them from a delegator account to a module account

func (Keeper) GetModuleAccount

func (k Keeper) GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI

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) GetSupply

func (k Keeper) GetSupply(ctx sdk.Context) (supply exported.SupplyI)

GetSupply retrieves the Supply from store

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintTokens

func (k Keeper) MintTokens(ctx sdk.Context, moduleName string, amt sdk.Tokens) sdk.Error

MintTokens creates new tokens from thin air and adds it to the module account. Panics if the name maps to a non-minter module account or if the amount is invalid.

func (Keeper) SendTokensFromAccountToModule

func (k Keeper) SendTokensFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress,
	recipientModule string, amt sdk.Tokens) sdk.Error

SendTokensFromAccountToModule transfers tokens from an AccAddress to a ModuleAccount

func (Keeper) SendTokensFromModuleToAccount

func (k Keeper) SendTokensFromModuleToAccount(ctx sdk.Context, senderModule string,
	recipientAddr sdk.AccAddress, amt sdk.Tokens) sdk.Error

SendTokensFromModuleToAccount transfers tokens from a ModuleAccount to an AccAddress

func (Keeper) SendTokensFromModuleToModule

func (k Keeper) SendTokensFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Tokens) sdk.Error

SendTokensFromModuleToModule transfers tokens from a ModuleAccount to another

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) SetSupply

func (k Keeper) SetSupply(ctx sdk.Context, supply exported.SupplyI)

SetSupply sets the Supply to store

func (Keeper) UndelegateTokensFromModuleToAccount

func (k Keeper) UndelegateTokensFromModuleToAccount(ctx sdk.Context, senderModule string,
	recipientAddr sdk.AccAddress, amt sdk.Tokens) sdk.Error

UndelegateTokensFromModuleToAccount undelegates the unbonding tokens and transfers them from a module account to the delegator account

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL