keeper

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyDelimiter      = []byte(types.KeyDelimiterString)
	PrefixActiveQueue = []byte("active")
)

Key for getting a the next available proposalID from the store

Functions

func KeyActiveBoxQueue

func KeyActiveBoxQueue(endTime int64, boxIdStr string) []byte

Returns the key for a proposalID in the activeQueue

func KeyAddress

func KeyAddress(boxType string, accAddress sdk.AccAddress) []byte

Key for getting a specific address from the store

func KeyAllBox added in v0.6.0

func KeyAllBox() []byte

func KeyBox

func KeyBox(boxIdStr string) []byte

func KeyIdStr added in v0.6.0

func KeyIdStr(boxType string, seq uint64) string

func KeyName

func KeyName(boxType string, name string) []byte

func KeyNextBoxID

func KeyNextBoxID(boxType string) []byte

Key for getting a specific issuer from the store

func PrefixActiveBoxQueueTime

func PrefixActiveBoxQueueTime(endTime int64) []byte

Returns the key for a id in the activeQueue

Types

type BankKeeper

type BankKeeper interface {
	GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
	SetSendEnabled(ctx sdk.Context, enabled bool)
}

expected bank keeper

type FeeCollectionKeeper added in v0.6.0

type FeeCollectionKeeper interface {
	AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
}

expected fee collection keeper

type Hooks added in v0.6.0

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

Wrapper struct

func (Hooks) CanSend added in v0.6.0

func (hooks Hooks) CanSend(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) (bool, sdk.Error)

type IssueKeeper

type IssueKeeper interface {
	GetIssue(ctx sdk.Context, issueID string) *types.CoinIssueInfo
}

expected issue keeper

type Keeper

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

Box Keeper

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramsKeeper params.Keeper,
	paramSpace params.Subspace, ck BankKeeper, ik IssueKeeper,
	feeCollectionKeeper FeeCollectionKeeper, codespace sdk.CodespaceType) Keeper

New box keeper Instance

func (Keeper) ActiveBoxQueueIterator

func (keeper Keeper) ActiveBoxQueueIterator(ctx sdk.Context, endTime int64) sdk.Iterator

Returns an iterator for all the box in the Active Queue that expire by time

func (Keeper) AddBox added in v0.6.0

func (keeper Keeper) AddBox(ctx sdk.Context, box *types.BoxInfo)

Keys Add Add box

func (Keeper) CanTransfer added in v0.6.0

func (keeper Keeper) CanTransfer(ctx sdk.Context, id string) sdk.Error

func (Keeper) CancelDepositedCoin added in v0.6.0

func (keeper Keeper) CancelDepositedCoin(ctx sdk.Context, toAddr sdk.AccAddress, amt sdk.Coins, id string) sdk.Error

func (Keeper) CancelInterestFromDepositBox added in v0.6.0

func (keeper Keeper) CancelInterestFromDepositBox(ctx sdk.Context, id string, sender sdk.AccAddress, interest sdk.Coin) (*types.BoxInfo, sdk.Error)

func (Keeper) CreateBox

func (keeper Keeper) CreateBox(ctx sdk.Context, box *types.BoxInfo) sdk.Error

Create a box

func (Keeper) DisableFeature

func (keeper Keeper) DisableFeature(ctx sdk.Context, sender sdk.AccAddress, id string, feature string) (*types.BoxInfo, sdk.Error)

func (Keeper) Fee added in v0.6.0

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

func (Keeper) GetBankKeeper

func (keeper Keeper) GetBankKeeper() BankKeeper

Get box bankKeeper

func (Keeper) GetBox

func (keeper Keeper) GetBox(ctx sdk.Context, id string) *types.BoxInfo

Keys return Return box by id

func (Keeper) GetBoxByAddress

func (keeper Keeper) GetBoxByAddress(ctx sdk.Context, boxType string, accAddress sdk.AccAddress) []*types.BoxInfo

Returns box list by type and accAddress

func (Keeper) GetBoxByOwner

func (keeper Keeper) GetBoxByOwner(ctx sdk.Context, sender sdk.AccAddress, id string) (*types.BoxInfo, sdk.Error)

Return box by id and and check owner

func (Keeper) GetCoinDecimals added in v0.6.0

func (keeper Keeper) GetCoinDecimals(ctx sdk.Context, coin sdk.Coin) (uint, sdk.Error)

Keys remove Remove box

func (keeper Keeper) RemoveBox(ctx sdk.Context, box *types.BoxInfo) {
	store := ctx.KVStore(keeper.storeKey)
	store.Delete(KeyName(box.BoxType, box.Name))
	store.Delete(KeyAddress(box.BoxType, box.Owner))
	store.Delete(KeyBox(box.Id))
}

func (Keeper) GetDepositedCoins

func (keeper Keeper) GetDepositedCoins(ctx sdk.Context, id string) sdk.Coins

func (Keeper) GetFeeCollectionKeeper added in v0.6.0

func (keeper Keeper) GetFeeCollectionKeeper() FeeCollectionKeeper

Get box feeCollectionKeeper

func (Keeper) GetIdsByAddress added in v0.6.0

func (keeper Keeper) GetIdsByAddress(ctx sdk.Context, boxType string, accAddress sdk.AccAddress) (ids []string)

Get address from a box

func (Keeper) GetIdsByName added in v0.6.0

func (keeper Keeper) GetIdsByName(ctx sdk.Context, boxType string, name string) (ids []string)

Get name from a box

func (Keeper) GetIssueKeeper

func (keeper Keeper) GetIssueKeeper() IssueKeeper

Get box issueKeeper

func (Keeper) GetLastBoxID

func (keeper Keeper) GetLastBoxID(ctx sdk.Context, boxType string) (id uint64)

Get the last used id

func (Keeper) GetParams added in v0.6.0

func (ak Keeper) GetParams(ctx sdk.Context) (params config.Params)

GetParams gets the auth module's parameters.

func (Keeper) Getcdc

func (keeper Keeper) Getcdc() *codec.Codec

Get box codec

func (Keeper) Hooks added in v0.6.0

func (keeper Keeper) Hooks() Hooks

Create new box hooks

func (Keeper) InjectDepositBoxInterest added in v0.6.0

func (keeper Keeper) InjectDepositBoxInterest(ctx sdk.Context, id string, sender sdk.AccAddress, interest sdk.Coin) (*types.BoxInfo, sdk.Error)

func (Keeper) InsertActiveBoxQueue

func (keeper Keeper) InsertActiveBoxQueue(ctx sdk.Context, endTime int64, boxIdStr string)

Inserts a id into the active box queue at time

func (Keeper) Iterator added in v0.6.0

func (keeper Keeper) Iterator(ctx sdk.Context, boxType string, startId string) sdk.Iterator

func (Keeper) List

func (keeper Keeper) List(ctx sdk.Context, params boxparams.BoxQueryParams) []*types.BoxInfo

List

func (Keeper) ListAll added in v0.6.0

func (keeper Keeper) ListAll(ctx sdk.Context, boxType string) []types.BoxInfo

func (Keeper) PeekCurrentBoxID

func (keeper Keeper) PeekCurrentBoxID(ctx sdk.Context, boxType string) (id uint64, err sdk.Error)

Peeks the next available BoxID without incrementing it

func (Keeper) ProcessBoxWithdraw added in v0.6.0

func (keeper Keeper) ProcessBoxWithdraw(ctx sdk.Context, id string, sender sdk.AccAddress) (sdk.Int, *types.BoxInfo, sdk.Error)

func (Keeper) ProcessDepositBoxByEndBlocker

func (keeper Keeper) ProcessDepositBoxByEndBlocker(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) ProcessDepositBoxCreate

func (keeper Keeper) ProcessDepositBoxCreate(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) ProcessFutureBoxByEndBlocker

func (keeper Keeper) ProcessFutureBoxByEndBlocker(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) ProcessFutureBoxCreate

func (keeper Keeper) ProcessFutureBoxCreate(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) ProcessInjectBox added in v0.6.0

func (keeper Keeper) ProcessInjectBox(ctx sdk.Context, id string, sender sdk.AccAddress, amount sdk.Coin, operation string) (*types.BoxInfo, sdk.Error)

func (Keeper) ProcessLockBoxByEndBlocker

func (keeper Keeper) ProcessLockBoxByEndBlocker(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) ProcessLockBoxCreate

func (keeper Keeper) ProcessLockBoxCreate(ctx sdk.Context, box *types.BoxInfo) sdk.Error

func (Keeper) RemoveFromActiveBoxQueue

func (keeper Keeper) RemoveFromActiveBoxQueue(ctx sdk.Context, endTime int64, boxIdStr string)

removes a id from the Active box Queue

func (Keeper) RemoveFromActiveBoxQueueByKey

func (keeper Keeper) RemoveFromActiveBoxQueueByKey(ctx sdk.Context, key []byte)

func (Keeper) SearchBox

func (keeper Keeper) SearchBox(ctx sdk.Context, boxType string, name string) []*types.BoxInfo

Search box by name

func (Keeper) SendCoins

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

Send coins

func (Keeper) SendDepositedCoin

func (keeper Keeper) SendDepositedCoin(ctx sdk.Context, fromAddr sdk.AccAddress, amt sdk.Coins, id string) sdk.Error

func (Keeper) SetBoxDescription

func (keeper Keeper) SetBoxDescription(ctx sdk.Context, id string, sender sdk.AccAddress, description []byte) (*types.BoxInfo, sdk.Error)

func (Keeper) SetInitialBoxStartingId added in v0.6.0

func (keeper Keeper) SetInitialBoxStartingId(ctx sdk.Context, boxType string, id uint64) sdk.Error

Set the initial boxCount

func (Keeper) SetParams added in v0.6.0

func (ak Keeper) SetParams(ctx sdk.Context, params config.Params)

SetParams sets the auth module's parameters.

func (Keeper) SubDepositedCoin

func (keeper Keeper) SubDepositedCoin(ctx sdk.Context, amt sdk.Coins, id string) sdk.Error

Jump to

Keyboard shortcuts

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