keeper

package
v0.0.0-...-18ecf46 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QueryLottery = "Lottery"
)

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

func (k Keeper) AddBet(ctx sdk.Context, player sdk.AccAddress, amount sdk.Coins, number uint64) (uint64, error)

func (Keeper) CloseLottery

func (k Keeper) CloseLottery(ctx sdk.Context)

close lottery

func (Keeper) CreateLottery

func (k Keeper) CreateLottery(ctx sdk.Context, status types.LotteryStatus, amount sdk.Coins) (uint64, error)

func (Keeper) GetBetCount

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

GetOrderCount returns the current number of all orders ever exist.

func (Keeper) GetBetsIterator

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

Get an iterator over all bets

func (Keeper) GetChannel

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

func (Keeper) GetLottery

func (k Keeper) GetLottery(ctx sdk.Context, id uint64) (types.Lottery, error)

GetLottery gets the given Lottery from the store

func (Keeper) GetLotteryCount

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

GetOrderCount returns the current number of all orders ever exist.

func (Keeper) GetNextBetCount

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

GetNextBetCount increments and returns the current number of bets. If the global bet count is not set, it initializes it with value 0.

func (Keeper) GetNextLotteryCount

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

GetNextLotteryCount increments and returns the current number of lotteries. If the global lottery count is not set, it initializes it with value 0.

func (Keeper) GetWinners

func (k Keeper) GetWinners(ctx sdk.Context, winningNumber uint64) ([]sdk.AccAddress, error)

func (Keeper) HasChannel

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

func (Keeper) SetBet

func (k Keeper) SetBet(ctx sdk.Context, id uint64, bet types.Bet, lotteryID uint64)

SetBet saves the given Bet to the open lottery to the store without performing any validation.

func (Keeper) SetChannel

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

func (Keeper) SetLottery

func (k Keeper) SetLottery(ctx sdk.Context, id uint64, lottery types.Lottery)

Jump to

Keyboard shortcuts

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