keeper

package
v0.0.2-0...-13a971e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyDelimiter   = ":"
	KeyNextIssueID = []byte("newIssueID")
)

Key for getting a the next available proposalID from the store

Functions

func KeyAddressIssues

func KeyAddressIssues(addr string) []byte

Key for getting a specific address from the store

func KeyAllowed

func KeyAllowed(issueID string, sender sdk.AccAddress, spender sdk.AccAddress) []byte

Key for getting a specific allowed from the store

func KeyFreeze

func KeyFreeze(issueID string, accAddress sdk.AccAddress) []byte

func KeyIssueIdStr

func KeyIssueIdStr(seq uint64) string

func KeyIssuer

func KeyIssuer(issueIdStr string) []byte
func BytesString(b []byte) string {
	return *(*string)(unsafe.Pointer(&b))
}

Key for getting a specific issuer from the store

func KeySymbolIssues

func KeySymbolIssues(symbol string) []byte

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier instance

func NonnegativeBalanceInvariant

func NonnegativeBalanceInvariant(ak types.AccountKeeper) sdk.Invariant

NonnegativeBalanceInvariant checks that all accounts in the application have non-negative balances

func PrefixFreeze

func PrefixFreeze(issueID string) []byte

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, ak types.AccountKeeper)

RegisterInvariants registers the bank module invariants

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Issue Keeper

func NewKeeper

func NewKeeper(
	key sdk.StoreKey,
	paramSpace params.Subspace,
	ck types.BankKeeper,
	sk types.SupplyKeeper,
	codespace sdk.CodespaceType,
	feeCollectorName string,
) Keeper

New issue keeper Instance

func (Keeper) AddIssue

func (k Keeper) AddIssue(ctx sdk.Context, coinIssueInfo *types.CoinIssueInfo)

Keys add Add a issue

func (Keeper) Allowance

func (k Keeper) Allowance(ctx sdk.Context, owner sdk.AccAddress, spender sdk.AccAddress, issueID string) (amount sdk.Int)

Get the amount of tokens that an owner allowed to a spender

func (Keeper) Approve

func (k Keeper) Approve(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, amount sdk.Int) sdk.Error

Approve the passed address to spend the specified amount of tokens on behalf of sender

func (Keeper) BurnFrom

func (k Keeper) BurnFrom(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress, who sdk.AccAddress) (sdk.Coins, sdk.Error)

func (Keeper) BurnHolder

func (k Keeper) BurnHolder(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress) (sdk.Coins, sdk.Error)

Burn a coin

func (Keeper) BurnOwner

func (k Keeper) BurnOwner(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress) (sdk.Coins, sdk.Error)

func (Keeper) CanMint

func (k Keeper) CanMint(ctx sdk.Context, issueID string) bool

Can mint a coin

func (Keeper) CheckFreeze

func (k Keeper) CheckFreeze(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, issueID string) sdk.Error

func (Keeper) CreateIssue

func (k Keeper) CreateIssue(ctx sdk.Context, coinIssueInfo *types.CoinIssueInfo) (sdk.Coins, sdk.Error)

Create a issue

func (Keeper) DecreaseApproval

func (k Keeper) DecreaseApproval(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, subtractedValue sdk.Int) sdk.Error

Decrease the amount of tokens that an owner allowed to a spender

func (Keeper) DisableFeature

func (k Keeper) DisableFeature(ctx sdk.Context, sender sdk.AccAddress, issueID string, feature string) sdk.Error

func (Keeper) Fee

func (k Keeper) Fee(ctx sdk.Context, sender sdk.AccAddress, fee sdk.Coin) sdk.Error

func (Keeper) Freeze

func (k Keeper) Freeze(ctx sdk.Context, issueID string, sender sdk.AccAddress, accAddress sdk.AccAddress, freezeType string) sdk.Error

func (Keeper) GetAddressIssues

func (k Keeper) GetAddressIssues(ctx sdk.Context, accAddress string) (issueIDs []string)

Get address from a issue

func (Keeper) GetBankKeeper

func (keeper Keeper) GetBankKeeper() types.BankKeeper

Get box bankKeeper

func (Keeper) GetFreeze

func (k Keeper) GetFreeze(ctx sdk.Context, accAddress sdk.AccAddress, issueID string) types.IssueFreeze

func (Keeper) GetFreezes

func (k Keeper) GetFreezes(ctx sdk.Context, issueID string) []types.IssueAddressFreeze

func (Keeper) GetIssue

func (k Keeper) GetIssue(ctx sdk.Context, issueID string) *types.CoinIssueInfo

Returns issue by issueID

func (Keeper) GetIssues

func (k Keeper) GetIssues(ctx sdk.Context, accAddress string) []*types.CoinIssueInfo

Returns issues by accAddress

func (Keeper) GetLastIssueID

func (k Keeper) GetLastIssueID(ctx sdk.Context) (issueID uint64)

Get the last used issueID

func (Keeper) GetParams

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

GetParams gets the auth module's parameters.

func (Keeper) GetSupplyKeeper

func (keeper Keeper) GetSupplyKeeper() types.SupplyKeeper

Get supplyKeeper for testing

func (Keeper) GetSymbolIssues

func (k Keeper) GetSymbolIssues(ctx sdk.Context, symbol string) (issueIDs []string)

Get issueIDs from a issue

func (Keeper) IncreaseApproval

func (k Keeper) IncreaseApproval(ctx sdk.Context, sender sdk.AccAddress, spender sdk.AccAddress, issueID string, addedValue sdk.Int) sdk.Error

Increase the amount of tokens that an owner allowed to a spender

func (Keeper) Iterator

func (k Keeper) Iterator(ctx sdk.Context, startIssueId string) sdk.Iterator

func (Keeper) List

func (k Keeper) List(ctx sdk.Context, params types.IssueQueryParams) []*types.CoinIssueInfo

func (Keeper) ListAll

func (k Keeper) ListAll(ctx sdk.Context) []types.CoinIssueInfo

func (Keeper) Mint

func (k Keeper) Mint(ctx sdk.Context, issueID string, amount sdk.Int, sender sdk.AccAddress, to sdk.AccAddress) (sdk.Coins, sdk.Error)

Mint a coin

func (Keeper) PeekCurrentIssueID

func (k Keeper) PeekCurrentIssueID(ctx sdk.Context) (issueID uint64, err sdk.Error)

Peeks the next available IssueID without incrementing it

func (Keeper) SearchIssues

func (k Keeper) SearchIssues(ctx sdk.Context, symbol string) []*types.CoinIssueInfo

func (Keeper) SendCoins

func (k Keeper) SendCoins(ctx sdk.Context,
	fromAddr sdk.AccAddress, toAddr sdk.AccAddress,
	amt sdk.Coins) sdk.Error

Send coins

func (Keeper) SendCoinsFromAccountToFeeCollector

func (k Keeper) SendCoinsFromAccountToFeeCollector(ctx sdk.Context, senderAddr sdk.AccAddress, amt sdk.Coins) sdk.Error

SendCoinsFromAccountToFeeCollector transfers amt to the fee collector account.

func (Keeper) SendFrom

func (k Keeper) SendFrom(ctx sdk.Context, sender sdk.AccAddress, from sdk.AccAddress, to sdk.AccAddress, issueID string, amount sdk.Int) sdk.Error

Transfer tokens from one address to another

func (Keeper) SetInitialIssueStartingIssueId

func (k Keeper) SetInitialIssueStartingIssueId(ctx sdk.Context, issueID uint64) sdk.Error

Set the initial issueCount

func (Keeper) SetIssueDescription

func (k Keeper) SetIssueDescription(ctx sdk.Context, issueID string, sender sdk.AccAddress, description []byte) sdk.Error

func (Keeper) SetParams

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

SetParams sets the auth module's parameters.

func (Keeper) TransferOwnership

func (k Keeper) TransferOwnership(ctx sdk.Context, issueID string, sender sdk.AccAddress, to sdk.AccAddress) sdk.Error

TransferOwnership

func (Keeper) UnFreeze

func (k Keeper) UnFreeze(ctx sdk.Context, issueID string, sender sdk.AccAddress, accAddress sdk.AccAddress, freezeType string) sdk.Error

Jump to

Keyboard shortcuts

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