Documentation ¶
Index ¶
- Constants
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) AddBet(ctx sdk.Context, player sdk.AccAddress, amount sdk.Coins, number uint64) (uint64, error)
- func (k Keeper) CloseLottery(ctx sdk.Context)
- func (k Keeper) CreateLottery(ctx sdk.Context, status types.LotteryStatus, amount sdk.Coins) (uint64, error)
- func (k Keeper) GetBetCount(ctx sdk.Context) uint64
- func (k Keeper) GetBetsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetChannel(ctx sdk.Context, chainName string, port string) (string, error)
- func (k Keeper) GetLottery(ctx sdk.Context, id uint64) (types.Lottery, error)
- func (k Keeper) GetLotteryCount(ctx sdk.Context) uint64
- func (k Keeper) GetNextBetCount(ctx sdk.Context) uint64
- func (k Keeper) GetNextLotteryCount(ctx sdk.Context) uint64
- func (k Keeper) GetWinners(ctx sdk.Context, winningNumber uint64) ([]sdk.AccAddress, error)
- func (k Keeper) HasChannel(ctx sdk.Context, chainName string, port string) bool
- func (k Keeper) SetBet(ctx sdk.Context, id uint64, bet types.Bet, lotteryID uint64)
- func (k Keeper) SetChannel(ctx sdk.Context, chainName string, port string, channel string)
- func (k Keeper) SetLottery(ctx sdk.Context, id uint64, lottery types.Lottery)
Constants ¶
const (
QueryLottery = "Lottery"
)
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
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) CreateLottery ¶
func (Keeper) GetBetCount ¶
GetOrderCount returns the current number of all orders ever exist.
func (Keeper) GetBetsIterator ¶
Get an iterator over all bets
func (Keeper) GetChannel ¶
func (Keeper) GetLottery ¶
GetLottery gets the given Lottery from the store
func (Keeper) GetLotteryCount ¶
GetOrderCount returns the current number of all orders ever exist.
func (Keeper) GetNextBetCount ¶
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 ¶
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 (Keeper) HasChannel ¶
func (Keeper) SetBet ¶
SetBet saves the given Bet to the open lottery to the store without performing any validation.