Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerierImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetCurrentDraw(ctx sdk.Context) types.Draw
- func (k Keeper) GetDistributionParams(ctx sdk.Context) types.DistributionParams
- func (k Keeper) GetDrawParams(ctx sdk.Context) types.DrawParams
- func (k Keeper) GetDrawParticipantsAndTickets(ctx sdk.Context) (participants []string, ticketsSold []types.Ticket)
- func (k Keeper) GetHistoricalDrawsData(ctx sdk.Context) []types.HistoricalDrawData
- func (k Keeper) GetTicketParams(ctx sdk.Context) types.TicketParams
- func (k Keeper) GetTickets(ctx sdk.Context) []types.Ticket
- func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
- func (k Keeper) IterateHistoricalDrawsData(ctx sdk.Context, ...)
- func (k Keeper) IterateTickets(ctx sdk.Context, fn func(index int64, ticket types.Ticket) (stop bool))
- func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SaveCurrentDrawEndTime(ctx sdk.Context, endTime time.Time)
- func (k Keeper) SaveHistoricalDraw(ctx sdk.Context, draw types.HistoricalDrawData)
- func (k Keeper) SaveTickets(ctx sdk.Context, tickets []types.Ticket)
- func (k Keeper) SetDistributionParams(ctx sdk.Context, params types.DistributionParams)
- func (k Keeper) SetDrawParams(ctx sdk.Context, params types.DrawParams)
- func (k Keeper) SetTicketParams(ctx sdk.Context, params types.TicketParams)
- func (k Keeper) TransferDrawPrize(ctx sdk.Context, prize sdk.Coins, winner sdk.AccAddress) error
- func (k Keeper) WipeCurrentTickets(ctx sdk.Context)
- func (k Keeper) WithdrawTicketsCost(ctx sdk.Context, quantity uint32, buyer sdk.AccAddress) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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 ¶
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 ¶
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 ¶
func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the currently stored parameters
func (Keeper) SaveCurrentDrawEndTime ¶ added in v0.1.1
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 ¶
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 ¶
TransferDrawPrize transfers the provided prize to the specified winner account
func (Keeper) WipeCurrentTickets ¶
WipeCurrentTickets removes all the currently stored tickets
func (Keeper) WithdrawTicketsCost ¶
WithdrawTicketsCost allows the provided buyer to buy the given quantity of tickets.