keeper

package
v0.0.0-...-4955b9a Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	Cdc *codec.Codec
	// contains filtered or unexported fields
}

Keeper of the supply store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, subspace sdk.Subspace, maccPerms map[string][]string) Keeper

NewKeeper creates a new Keeper instance

func (Keeper) AddCoins

func (k Keeper) AddCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)

AddCoins adds amt to the coins at the addr.

func (Keeper) BurnCoins

func (k Keeper) BurnCoins(ctx sdk.Ctx, moduleName string, amt sdk.Coins) sdk.Error

BurnCoins burns coins deletes coins 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) Codespace

func (k Keeper) Codespace() sdk.CodespaceType

Codespace returns the keeper's codespace.

func (Keeper) ConvertState

func (k Keeper) ConvertState(ctx sdk.Ctx)

func (Keeper) DecodeAccount

func (k Keeper) DecodeAccount(bz []byte, ctx sdk.Ctx) (exported.Account, error)

"DecodeAccount" - decodes into account interface

func (Keeper) DecodeBaseAccount

func (k Keeper) DecodeBaseAccount(bz []byte, ctx sdk.Ctx) (exported.Account, error)

func (Keeper) DecodeModuleAccount

func (k Keeper) DecodeModuleAccount(bz []byte, ctx sdk.Ctx) (exported.ModuleAccountI, error)

"DecodeModuleAccount" - encodes account interface into protobuf

func (Keeper) DecodeSupply

func (k Keeper) DecodeSupply(ctx sdk.Ctx, bz []byte) (exported.SupplyI, error)

func (Keeper) EncodeAccount

func (k Keeper) EncodeAccount(acc exported.Account, ctx sdk.Ctx) ([]byte, error)

"EncodeAccount" - encodes the account interface to bz

func (Keeper) EncodeBaseAccount

func (k Keeper) EncodeBaseAccount(acc *types.BaseAccount, ctx sdk.Ctx) ([]byte, error)

func (Keeper) EncodeModuleAccount

func (k Keeper) EncodeModuleAccount(macc *types.ModuleAccount, ctx sdk.Ctx) ([]byte, error)

"DecodeModuleAccount" - encodes account interface into protobuf

func (Keeper) EncodeSupply

func (k Keeper) EncodeSupply(ctx sdk.Ctx, supply exported.SupplyI) ([]byte, error)

func (Keeper) GetAccount

func (k Keeper) GetAccount(ctx sdk.Ctx, addr sdk.Address) exported.Account

GetAccount implements sdk.Keeper.

func (Keeper) GetAllAccounts

func (k Keeper) GetAllAccounts(ctx sdk.Ctx) []exported.Account

GetAllAccounts returns all accounts in the accountKeeper.

func (Keeper) GetAllAccountsExport

func (k Keeper) GetAllAccountsExport(ctx sdk.Ctx) []exported.Account

GetAllAccounts returns all accounts in the accountKeeper.

func (Keeper) GetCoins

func (k Keeper) GetCoins(ctx sdk.Ctx, addr sdk.Address) sdk.Coins

GetCoins returns the coins at the addr.

func (Keeper) GetFee

func (k Keeper) GetFee(ctx sdk.Ctx, msg sdk.Msg) sdk.BigInt

func (Keeper) GetModuleAccount

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

GetModuleAccount gets the module account from the auth account store

func (Keeper) GetModuleAccountAndPermissions

func (k Keeper) GetModuleAccountAndPermissions(ctx sdk.Ctx, 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.Address

GetModuleAddress returns an address based on the module name

func (Keeper) GetModuleAddressAndPermissions

func (k Keeper) GetModuleAddressAndPermissions(moduleName string) (addr sdk.Address, permissions []string)

GetModuleAddressAndPermissions returns an address and permissions based on the module name

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Ctx) (params types.Params)

GetParams gets the auth module's parameters.

func (Keeper) GetSupply

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

GetSupply retrieves the Supply from store

func (Keeper) HasCoins

func (k Keeper) HasCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) bool

HasCoins returns whether or not an account has at least amt coins.

func (Keeper) IterateAccounts

func (k Keeper) IterateAccounts(ctx sdk.Ctx, process func(exported.Account) (stop bool))

IterateAccounts implements sdk.Keeper.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MintCoins

func (k Keeper) MintCoins(ctx sdk.Ctx, moduleName string, amt sdk.Coins) sdk.Error

MintCoins creates new coins 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) NewAccount

func (k Keeper) NewAccount(ctx sdk.Ctx, acc exported.Account) exported.Account

NewAccount creates a new account

func (Keeper) NewAccountWithAddress

func (k Keeper) NewAccountWithAddress(ctx sdk.Ctx, addr sdk.Address) (*types.BaseAccount, error)

NewAccountWithAddress implements sdk.AuthKeeper.

func (Keeper) RemoveAccount

func (k Keeper) RemoveAccount(ctx sdk.Ctx, acc exported.Account)

RemoveAccount removes an account for the account mapper store. NOTE: this will cause supply invariant violation if called

func (Keeper) SendCoins

func (k Keeper) SendCoins(ctx sdk.Ctx, fromAddr sdk.Address, toAddr sdk.Address, amt sdk.Coins) sdk.Error

SendCoins moves coins from one account to another

func (Keeper) SendCoinsFromAccountToModule

func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Ctx, senderAddr sdk.Address,
	recipientModule string, amt sdk.Coins) sdk.Error

SendCoinsFromAccountToModule transfers coins from an Address to a ModuleAccount

func (Keeper) SendCoinsFromModuleToAccount

func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Ctx, senderModule string,
	recipientAddr sdk.Address, amt sdk.Coins) sdk.Error

SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an Address

func (Keeper) SendCoinsFromModuleToModule

func (k Keeper) SendCoinsFromModuleToModule(ctx sdk.Ctx, senderModule, recipientModule string, amt sdk.Coins) sdk.Error

SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another

func (Keeper) SetAccount

func (k Keeper) SetAccount(ctx sdk.Ctx, acc exported.Account)

SetAccount implements sdk.Keeper.

func (Keeper) SetAccounts

func (k Keeper) SetAccounts(ctx sdk.Ctx, acc []exported.Account)

func (Keeper) SetCoins

func (k Keeper) SetCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) sdk.Error

SetCoins sets the coins at the addr.

func (Keeper) SetModuleAccount

func (k Keeper) SetModuleAccount(ctx sdk.Ctx, macc exported.ModuleAccountI)

SetModuleAccount sets the module account to the auth account store

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Ctx, params types.Params)

SetParams sets the auth module's parameters.

func (Keeper) SetSupply

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

SetSupply sets the Supply to store

func (Keeper) SubtractCoins

func (k Keeper) SubtractCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)

SubtractCoins subtracts amt from the coins at the addr.

func (Keeper) UpgradeCodec

func (k Keeper) UpgradeCodec(ctx sdk.Ctx)

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