keeper

package
v0.0.0-...-6b2e056 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QueryOrder = "order"

	QueryProduct  = "product"
	QueryProducts = "products"

	QuerySell  = "sell"
	QuerySells = "sells"

	QueryReservation          = "reservation"
	QueryReservations         = "reservations"
	QueryReservationsBySellID = "reservationsBySellID"
	QueryProductsByOwner      = "productsByOwner"
)

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

func (k Keeper) DeleteReservation(ctx sdk.Context, key string)

DeleteSell deletes the entire Sell metadata struct for a sell

func (Keeper) DeleteSell

func (k Keeper) DeleteSell(ctx sdk.Context, key string)

DeleteSell deletes the entire Sell metadata struct for a sell

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

func (k Keeper) GetProduct(ctx sdk.Context, key string) (types.Product, error)

GetProduct gets the entire Product metadata struct for a name

func (Keeper) GetProductCategory

func (k Keeper) GetProductCategory(ctx sdk.Context, key string) (string, error)

GetProductCategory gets product description

func (Keeper) GetProductDescription

func (k Keeper) GetProductDescription(ctx sdk.Context, key string) (string, error)

GetProductDescription gets product description

func (Keeper) GetProductImages

func (k Keeper) GetProductImages(ctx sdk.Context, key string) (string, error)

GetProductImages gets product description

func (Keeper) GetProductOwner

func (k Keeper) GetProductOwner(ctx sdk.Context, key string) (sdk.AccAddress, error)

GetProductOwner gets product owner

func (Keeper) GetProductTitle

func (k Keeper) GetProductTitle(ctx sdk.Context, key string) (string, error)

GetProductTitle gets product title

func (Keeper) GetProductsIterator

func (k Keeper) GetProductsIterator(ctx sdk.Context) sdk.Iterator

GetProductsIterator gets an iterator over all product in which the keys are the productID and the values are the product

func (Keeper) GetReservation

func (k Keeper) GetReservation(ctx sdk.Context, key string) (types.Reservation, error)

GetReservation gets the entire reservation metadata struct for a reservation

func (Keeper) GetReservationsIterator

func (k Keeper) GetReservationsIterator(ctx sdk.Context) sdk.Iterator

GetReservationsIterator gets an iterator over all reservations in which the keys are the reservationID and the values are the reservation

func (Keeper) GetSell

func (k Keeper) GetSell(ctx sdk.Context, key string) (types.Sell, error)

GetSell gets the entire Sell metadata struct for a name

func (Keeper) GetSellsIterator

func (k Keeper) GetSellsIterator(ctx sdk.Context) sdk.Iterator

GetSellsIterator gets an iterator over all sell in which the keys are the sellID and the values are the sell

func (Keeper) HasChannel

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

func (Keeper) IsProductPresent

func (k Keeper) IsProductPresent(ctx sdk.Context, key string) bool

IsProductPresent checks if the product is present in the store or not

func (Keeper) IsReservationPresent

func (k Keeper) IsReservationPresent(ctx sdk.Context, key string) bool

IsReservationPresent checks if the reservation is present in the store or not

func (Keeper) IsSellPresent

func (k Keeper) IsSellPresent(ctx sdk.Context, key string) bool

IsSellPresent checks if the sell is present in the store or not

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.

func (Keeper) SetProduct

func (k Keeper) SetProduct(ctx sdk.Context, key string, product types.Product)

CreateProduct sets the entire Product metadata struct for a product

func (Keeper) SetReservation

func (k Keeper) SetReservation(ctx sdk.Context, key string, reservation types.Reservation)

SetReservation sets the entire sell metadata struct for a reservation

func (Keeper) SetSell

func (k Keeper) SetSell(ctx sdk.Context, key string, sell types.Sell)

SetSell sets the entire sell metadata struct for a sell

Jump to

Keyboard shortcuts

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