keeper

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the wta MsgServer interface for the provided Keeper.

func NewQuerierImpl

func NewQuerierImpl(k Keeper) types.QueryServer

NewMsgServerImpl returns an implementation of the wta QueryServer interface for the provided Keeper.

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(
	cdc codec.BinaryMarshaler, storeKey sdk.StoreKey, paramSpace paramstypes.Subspace,
	ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, dk distrkeeper.Keeper,
	feeCollectorName string,
) Keeper

NewKeeper creates new instances of the wta Keeper

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis exports the current state of the chain

func (Keeper) GetCurrentDraw

func (k Keeper) GetCurrentDraw(ctx sdk.Context) types.Draw

GetCurrentDraw returns the Draw for which the tickets can be currently bought

func (Keeper) GetDistributionParams added in v0.1.1

func (k Keeper) GetDistributionParams(ctx sdk.Context) types.DistributionParams

GetDistributionParams returns the current DistributionParams from the global param store

func (Keeper) GetDrawParams added in v0.1.1

func (k Keeper) GetDrawParams(ctx sdk.Context) types.DrawParams

GetDrawParams returns the current DrawParams from the global param store

func (Keeper) GetDrawParticipantsAndTickets added in v0.1.1

func (k Keeper) GetDrawParticipantsAndTickets(ctx sdk.Context) (participants []string, ticketsSold []types.Ticket)

GetDrawParticipantsAndTickets returns the list of participants that have entered the draw, and the list of all tickets sold for such draw

func (Keeper) GetHistoricalDrawsData

func (k Keeper) GetHistoricalDrawsData(ctx sdk.Context) []types.HistoricalDrawData

GetHistoricalDrawsData returns the list of historical draws data currently stored

func (Keeper) GetTicketParams added in v0.1.1

func (k Keeper) GetTicketParams(ctx sdk.Context) types.TicketParams

GetTicketParams returns the current TicketParams from the global param store

func (Keeper) GetTickets

func (k Keeper) GetTickets(ctx sdk.Context) []types.Ticket

GetTickets returns the list of tickets currently stored

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)

InitGenesis initializes the given state

func (Keeper) IterateHistoricalDrawsData

func (k Keeper) IterateHistoricalDrawsData(ctx sdk.Context, fn func(index int64, data types.HistoricalDrawData) (stop bool))

IterateHistoricalDrawsData iterates through the historical data and performs the provided function

func (Keeper) IterateTickets

func (k Keeper) IterateTickets(ctx sdk.Context, fn func(index int64, ticket types.Ticket) (stop bool))

IterateTickets iterates through the tickets and performs the provided function

func (Keeper) Params

Params queries the currently stored parameters

func (Keeper) SaveCurrentDrawEndTime added in v0.1.1

func (k Keeper) SaveCurrentDrawEndTime(ctx sdk.Context, endTime time.Time)

SaveCurrentDraw stores the given draw as the next draw

func (Keeper) SaveHistoricalDraw

func (k Keeper) SaveHistoricalDraw(ctx sdk.Context, draw types.HistoricalDrawData)

SaveHistoricalDraw saves the given draw as an historical draw

func (Keeper) SaveTickets

func (k Keeper) SaveTickets(ctx sdk.Context, tickets []types.Ticket)

SaveTickets sets the given tickets for the given user

func (Keeper) SetDistributionParams added in v0.1.1

func (k Keeper) SetDistributionParams(ctx sdk.Context, params types.DistributionParams)

SetDistributionParams sets DistributionParams to the global param store

func (Keeper) SetDrawParams added in v0.1.1

func (k Keeper) SetDrawParams(ctx sdk.Context, params types.DrawParams)

SetDrawParams sets DrawParams to the global param store

func (Keeper) SetTicketParams added in v0.1.1

func (k Keeper) SetTicketParams(ctx sdk.Context, params types.TicketParams)

SetTicketParams sets TicketParams to the global param store

func (Keeper) TransferDrawPrize

func (k Keeper) TransferDrawPrize(ctx sdk.Context, prize sdk.Coins, winner sdk.AccAddress) error

TransferDrawPrize transfers the provided prize to the specified winner account

func (Keeper) WipeCurrentTickets

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

WipeCurrentTickets removes all the currently stored tickets

func (Keeper) WithdrawTicketsCost

func (k Keeper) WithdrawTicketsCost(ctx sdk.Context, quantity uint32, buyer sdk.AccAddress) error

WithdrawTicketsCost allows the provided buyer to buy the given quantity of tickets.

Jump to

Keyboard shortcuts

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