keeper

package
v0.0.0-...-410e5a8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryOrder = "order"
)

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries.

Types

type Keeper

type Keeper struct {
	BankKeeper    types.BankKeeper
	ChannelKeeper types.ChannelKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, bankKeeper types.BankKeeper,
	channelKeeper types.ChannelKeeper,
) Keeper

NewKeeper creates a new band consumer Keeper instance.

func (Keeper) AddOrder

func (k Keeper) AddOrder(ctx sdk.Context, buyer sdk.AccAddress, amount sdk.Coins) (uint64, error)

func (Keeper) GetChannel

func (k Keeper) GetChannel(ctx sdk.Context, chainName string, port string) (string, error)

func (Keeper) GetNextOrderCount

func (k Keeper) GetNextOrderCount(ctx sdk.Context) uint64

GetNextOrderCount increments and returns the current number of orders. If the global order count is not set, it initializes it with value 0.

func (Keeper) GetOrder

func (k Keeper) GetOrder(ctx sdk.Context, id uint64) (types.Order, error)

GetOrder gets the given order from the store

func (Keeper) GetOrderCount

func (k Keeper) GetOrderCount(ctx sdk.Context) uint64

GetOrderCount returns the current number of all orders ever exist.

func (Keeper) HasChannel

func (k Keeper) HasChannel(ctx sdk.Context, chainName string, port string) bool

func (Keeper) SetChannel

func (k Keeper) SetChannel(ctx sdk.Context, chainName string, port string, channel string)

func (Keeper) SetOrder

func (k Keeper) SetOrder(ctx sdk.Context, id uint64, order types.Order)

SetOrder saves the given order to the store without performing any validation.

Jump to

Keyboard shortcuts

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