types

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: 33 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeBuyTicket     = "buy_ticket"
	EventTypePrizeIncrease = "prize_increase"
	EventTypeWinnerDrawn   = "winner_drawn"
	EventTypeNewDraw       = "new_draw"

	AttributeKeyTicketID        = "ticket_id"
	AttributeKeyTicketBuyer     = "ticket_buyer"
	AttributeKeyTicketTimestamp = "ticket_timestamp"
	AttributeKeyPrizeAmount     = "prize_amount"
	AttributeKeyWinnerAddress   = "winner_address"
	AttributeKeyWonAmount       = "won_amount"
	AttributeKeyDrawClosing     = "draw_closing"
)
View Source
const (
	// ModuleName is the name of the wta module
	ModuleName = "wta"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the wta module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the wta module
	RouterKey = ModuleName

	PrizeCollectorName = "wta_prize_collector"
	PrizeBurnerName    = "wta_prize_burner"
)
View Source
const (
	// Default draw duration
	DefaultDrawDuration = time.Hour

	// Min draw duration
	MinDrawDuration = time.Minute
)
View Source
const (
	TypeMsgBuyTickets = "buy_tickets"
)

Variables

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	CurrentDrawEndTimeStoreKey = []byte{0x1}
	HistoricalDrawStorePrefix  = []byte("historical_draw")
	TicketsStorePrefix         = []byte("ticket")
)
View Source
var (
	ErrInvalidLengthModels        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowModels          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMsgs        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsgs          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	DefaultPrizePercentage = sdk.NewDecWithPrec(98, 2)                                           // 98%
	DefaultBurnPercentage  = sdk.NewDecWithPrec(1, 2)                                            // 1%
	DefaultFeePercentage   = sdk.NewDecWithPrec(1, 2)                                            // 1%
	DefaultTicketPrice     = sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(10)) // 10 Tokens
)

Default wta params

View Source
var (
	ParamStoreDistributionParamsKey = []byte("DistributionParams")
	ParamStoreDrawParamsKey         = []byte("DrawParams")
	ParamStoreTicketParamsKey       = []byte("TicketParams")
)

Parameters store keys

View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (

	// ModuleCdc references the global x/wda module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/wda and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func HistoricalDataStoreKey

func HistoricalDataStoreKey(timestamp time.Time) []byte

HistoricalDataStoreKey returns the store key used to save a historical data entry with the given timestamp

func IsTicketIDDuplicated

func IsTicketIDDuplicated(id string, slice []Ticket) bool

IsTicketIDDuplicated tells whether or not the given id is duplicated inside the provided slice

func MarshalHistoricalDraw

func MarshalHistoricalDraw(cdc codec.BinaryMarshaler, draw HistoricalDrawData) ([]byte, error)

MarshalHistoricalDraw marshals the given historical draw as a byte array

func MarshalTicket

func MarshalTicket(cdc codec.BinaryMarshaler, ticket Ticket) ([]byte, error)

MarshalTicket marshals the given ticket to a slice of bytes

func MustMarshalDrawEndTime added in v0.1.1

func MustMarshalDrawEndTime(endTime time.Time) []byte

MustMarshalDraw marshals the given time.Time as a byte array and panics on error

func MustMarshalHistoricalDraw

func MustMarshalHistoricalDraw(cdc codec.BinaryMarshaler, draw HistoricalDrawData) []byte

MustMarshalHistoricalDraw marshals the given draws as a byte array

func MustMarshalTicket

func MustMarshalTicket(cdc codec.BinaryMarshaler, ticket Ticket) []byte

MustMarshalTicket marshals the given ticket into a slice of bytes, and panics on error

func MustUnmarshalDrawEndTime added in v0.1.1

func MustUnmarshalDrawEndTime(bz []byte) time.Time

MustUnmarshalDraw unmarshals the given byte slice into a time.Time object

func NewRandFromCtx

func NewRandFromCtx(ctx sdk.Context) *rand.Rand

NewRandFromCtx returns a new rand.Rand based on the given context

func NewRandFromCtxAndIndex

func NewRandFromCtxAndIndex(ctx sdk.Context, i int) *rand.Rand

NewRandFromCtxAndIndex returns a new rand.Rand based on the given context and index

func NewRandFromSeed

func NewRandFromSeed(seed []byte) *rand.Rand

NewRandFromSeed returns a new deterministic rand.Rand using the given byte slice as seed

func ParamKeyTable

func ParamKeyTable() paramstypes.KeyTable

ParamKeyTable Key declaration for parameters

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func TicketsStoreKey

func TicketsStoreKey(id string) []byte

TicketsStoreKey returns the store key used to save the ticket with the given id

func ValidateDistributionParams added in v0.1.1

func ValidateDistributionParams(i interface{}) error

func ValidateDrawParams added in v0.1.1

func ValidateDrawParams(i interface{}) error

func ValidateGenesis

func ValidateGenesis(state *GenesisState) error

ValidateGenesis validates the given genesis state and returns an error if something is invalid

func ValidateTicketParams added in v0.1.1

func ValidateTicketParams(i interface{}) error

Types

type DistributionParams added in v0.1.1

type DistributionParams struct {
	// Percentage of the ticket cost that should be sent to the prize pool,
	// represented as a value between 0.00 and 1.00.
	PrizePercentage github_com_cosmos_cosmos_sdk_types.Dec `` /* 146-byte string literal not displayed */
	// Percentage of the ticket cost that should be burnt,
	// represented as a value between 0.00 and 1.00.
	BurnPercentage github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// Percentage of the ticket cost that should be considered as a fee,
	// represented as a value between 0.00 and 1.00.
	FeePercentage github_com_cosmos_cosmos_sdk_types.Dec `` /* 140-byte string literal not displayed */
}

DistributionParams contains the parameters of the distribution of the prize

func DefaultDistributionParams added in v0.1.1

func DefaultDistributionParams() DistributionParams

func NewDistributionParams added in v0.1.1

func NewDistributionParams(prizePercentage, feePercentage, burnPercentage sdk.Dec) DistributionParams

func (*DistributionParams) Descriptor added in v0.1.1

func (*DistributionParams) Descriptor() ([]byte, []int)

func (*DistributionParams) Marshal added in v0.1.1

func (m *DistributionParams) Marshal() (dAtA []byte, err error)

func (*DistributionParams) MarshalTo added in v0.1.1

func (m *DistributionParams) MarshalTo(dAtA []byte) (int, error)

func (*DistributionParams) MarshalToSizedBuffer added in v0.1.1

func (m *DistributionParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DistributionParams) ProtoMessage added in v0.1.1

func (*DistributionParams) ProtoMessage()

func (*DistributionParams) Reset added in v0.1.1

func (m *DistributionParams) Reset()

func (*DistributionParams) Size added in v0.1.1

func (m *DistributionParams) Size() (n int)

func (*DistributionParams) String added in v0.1.1

func (m *DistributionParams) String() string

func (*DistributionParams) Unmarshal added in v0.1.1

func (m *DistributionParams) Unmarshal(dAtA []byte) error

func (*DistributionParams) XXX_DiscardUnknown added in v0.1.1

func (m *DistributionParams) XXX_DiscardUnknown()

func (*DistributionParams) XXX_Marshal added in v0.1.1

func (m *DistributionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DistributionParams) XXX_Merge added in v0.1.1

func (m *DistributionParams) XXX_Merge(src proto.Message)

func (*DistributionParams) XXX_Size added in v0.1.1

func (m *DistributionParams) XXX_Size() int

func (*DistributionParams) XXX_Unmarshal added in v0.1.1

func (m *DistributionParams) XXX_Unmarshal(b []byte) error

type Draw

type Draw struct {
	Participants uint32                                   `protobuf:"varint,1,opt,name=participants,proto3" json:"participants,omitempty"`
	TicketsSold  uint32                                   `protobuf:"varint,2,opt,name=tickets_sold,json=ticketsSold,proto3" json:"tickets_sold,omitempty"`
	Prize        github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=prize,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"prize"`
	EndTime      time.Time                                `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"`
}

Draw contains the data of the next planned draw

func NewDraw

func NewDraw(participants, ticketsSold uint32, prize sdk.Coins, endTime time.Time) Draw

NewDraw allows to build a new Draw instance

func (*Draw) Descriptor

func (*Draw) Descriptor() ([]byte, []int)

func (Draw) Equal

func (d Draw) Equal(e Draw) bool

Equal tells whether d and e contain the same data

func (*Draw) GetEndTime

func (m *Draw) GetEndTime() time.Time

func (*Draw) GetParticipants

func (m *Draw) GetParticipants() uint32

func (*Draw) GetPrize

func (*Draw) GetTicketsSold

func (m *Draw) GetTicketsSold() uint32

func (*Draw) Marshal

func (m *Draw) Marshal() (dAtA []byte, err error)

func (*Draw) MarshalTo

func (m *Draw) MarshalTo(dAtA []byte) (int, error)

func (*Draw) MarshalToSizedBuffer

func (m *Draw) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Draw) ProtoMessage

func (*Draw) ProtoMessage()

func (*Draw) Reset

func (m *Draw) Reset()

func (*Draw) Size

func (m *Draw) Size() (n int)

func (*Draw) String

func (m *Draw) String() string

func (*Draw) Unmarshal

func (m *Draw) Unmarshal(dAtA []byte) error

func (Draw) Validate

func (d Draw) Validate() error

Validate returns an error if there is something wrong with the provided Draw

func (*Draw) XXX_DiscardUnknown

func (m *Draw) XXX_DiscardUnknown()

func (*Draw) XXX_Marshal

func (m *Draw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Draw) XXX_Merge

func (m *Draw) XXX_Merge(src proto.Message)

func (*Draw) XXX_Size

func (m *Draw) XXX_Size() int

func (*Draw) XXX_Unmarshal

func (m *Draw) XXX_Unmarshal(b []byte) error

type DrawParams added in v0.1.1

type DrawParams struct {
	// Duration of each draw, after which the winner is picked and a new draw is
	// created
	Duration time.Duration `protobuf:"bytes,4,opt,name=duration,proto3,stdduration" json:"duration"`
}

DrawParams contain the parameters for each draw

func DefaultDrawParams added in v0.1.1

func DefaultDrawParams() DrawParams

func NewDrawParams added in v0.1.1

func NewDrawParams(duration time.Duration) DrawParams

func (*DrawParams) Descriptor added in v0.1.1

func (*DrawParams) Descriptor() ([]byte, []int)

func (*DrawParams) GetDuration added in v0.1.1

func (m *DrawParams) GetDuration() time.Duration

func (*DrawParams) Marshal added in v0.1.1

func (m *DrawParams) Marshal() (dAtA []byte, err error)

func (*DrawParams) MarshalTo added in v0.1.1

func (m *DrawParams) MarshalTo(dAtA []byte) (int, error)

func (*DrawParams) MarshalToSizedBuffer added in v0.1.1

func (m *DrawParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DrawParams) ProtoMessage added in v0.1.1

func (*DrawParams) ProtoMessage()

func (*DrawParams) Reset added in v0.1.1

func (m *DrawParams) Reset()

func (*DrawParams) Size added in v0.1.1

func (m *DrawParams) Size() (n int)

func (*DrawParams) String added in v0.1.1

func (m *DrawParams) String() string

func (*DrawParams) Unmarshal added in v0.1.1

func (m *DrawParams) Unmarshal(dAtA []byte) error

func (*DrawParams) XXX_DiscardUnknown added in v0.1.1

func (m *DrawParams) XXX_DiscardUnknown()

func (*DrawParams) XXX_Marshal added in v0.1.1

func (m *DrawParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DrawParams) XXX_Merge added in v0.1.1

func (m *DrawParams) XXX_Merge(src proto.Message)

func (*DrawParams) XXX_Size added in v0.1.1

func (m *DrawParams) XXX_Size() int

func (*DrawParams) XXX_Unmarshal added in v0.1.1

func (m *DrawParams) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	// Defines the end time of the next draw
	DrawEndTime time.Time `protobuf:"bytes,1,opt,name=draw_end_time,json=drawEndTime,proto3,stdtime" json:"draw_end_time"`
	// Defines all the tickets present at genesis time
	Tickets []Ticket `protobuf:"bytes,2,rep,name=tickets,proto3" json:"tickets"`
	// Defines the past draws present at genesis time
	PastDraws []HistoricalDrawData `protobuf:"bytes,3,rep,name=past_draws,json=pastDraws,proto3" json:"past_draws"`
	// Represents the parameters related to the prize distribution
	DistributionParams DistributionParams `protobuf:"bytes,4,opt,name=distribution_params,json=distributionParams,proto3" json:"distribution_params"`
	// Represents the parameters related to each draw
	DrawParams DrawParams `protobuf:"bytes,5,opt,name=draw_params,json=drawParams,proto3" json:"draw_params"`
	// Represents the parameters related to each ticket
	TicketParams TicketParams `protobuf:"bytes,6,opt,name=ticket_params,json=ticketParams,proto3" json:"ticket_params"`
}

GenesisState contains the data of the genesis state for the wda module

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns a default GenesisState

func NewGenesisState

func NewGenesisState(
	drawEndTime time.Time, tickets []Ticket, pastDraws []HistoricalDrawData,
	distributionParams DistributionParams, drawParams DrawParams, ticketParams TicketParams,
) *GenesisState

NewGenesisState returns a new GenesisState containing the provided data

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetDistributionParams added in v0.1.1

func (m *GenesisState) GetDistributionParams() DistributionParams

func (*GenesisState) GetDrawEndTime added in v0.1.1

func (m *GenesisState) GetDrawEndTime() time.Time

func (*GenesisState) GetDrawParams added in v0.1.1

func (m *GenesisState) GetDrawParams() DrawParams

func (*GenesisState) GetPastDraws

func (m *GenesisState) GetPastDraws() []HistoricalDrawData

func (*GenesisState) GetTicketParams added in v0.1.1

func (m *GenesisState) GetTicketParams() TicketParams

func (*GenesisState) GetTickets

func (m *GenesisState) GetTickets() []Ticket

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type HistoricalDrawData

type HistoricalDrawData struct {
	Draw          Draw   `protobuf:"bytes,1,opt,name=draw,proto3" json:"draw"`
	WinningTicket Ticket `protobuf:"bytes,2,opt,name=winning_ticket,json=winningTicket,proto3" json:"winning_ticket"`
}

HistoricalDrawData contains the data of a past draw and its winner

func MustUnmarshalHistoricalDrawData

func MustUnmarshalHistoricalDrawData(cdc codec.BinaryMarshaler, bz []byte) HistoricalDrawData

MustUnmarshalHistoricalDrawData unmarshals the given byte array as a HistoricalDrawData object and panics on errors

func NewHistoricalDrawData

func NewHistoricalDrawData(draw Draw, winningTicket Ticket) HistoricalDrawData

NewHistoricalDrawData creates a new HistoricalDrawData

func UnmarshalHistoricalDraw

func UnmarshalHistoricalDraw(cdc codec.BinaryMarshaler, bz []byte) (HistoricalDrawData, error)

UnmarshalHistoricalDraw unmarshals the given byte array as a HistoricalDrawData object

func (*HistoricalDrawData) Descriptor

func (*HistoricalDrawData) Descriptor() ([]byte, []int)

func (*HistoricalDrawData) GetDraw

func (m *HistoricalDrawData) GetDraw() Draw

func (*HistoricalDrawData) GetWinningTicket

func (m *HistoricalDrawData) GetWinningTicket() Ticket

func (*HistoricalDrawData) Marshal

func (m *HistoricalDrawData) Marshal() (dAtA []byte, err error)

func (*HistoricalDrawData) MarshalTo

func (m *HistoricalDrawData) MarshalTo(dAtA []byte) (int, error)

func (*HistoricalDrawData) MarshalToSizedBuffer

func (m *HistoricalDrawData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HistoricalDrawData) ProtoMessage

func (*HistoricalDrawData) ProtoMessage()

func (*HistoricalDrawData) Reset

func (m *HistoricalDrawData) Reset()

func (*HistoricalDrawData) Size

func (m *HistoricalDrawData) Size() (n int)

func (*HistoricalDrawData) String

func (m *HistoricalDrawData) String() string

func (*HistoricalDrawData) Unmarshal

func (m *HistoricalDrawData) Unmarshal(dAtA []byte) error

func (*HistoricalDrawData) Validate

func (h *HistoricalDrawData) Validate() error

func (*HistoricalDrawData) XXX_DiscardUnknown

func (m *HistoricalDrawData) XXX_DiscardUnknown()

func (*HistoricalDrawData) XXX_Marshal

func (m *HistoricalDrawData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HistoricalDrawData) XXX_Merge

func (m *HistoricalDrawData) XXX_Merge(src proto.Message)

func (*HistoricalDrawData) XXX_Size

func (m *HistoricalDrawData) XXX_Size() int

func (*HistoricalDrawData) XXX_Unmarshal

func (m *HistoricalDrawData) XXX_Unmarshal(b []byte) error

type MsgBuyTickets

type MsgBuyTickets struct {
	Quantity uint32 `protobuf:"varint,1,opt,name=quantity,proto3" json:"quantity,omitempty" yaml:"quantity"`
	Buyer    string `protobuf:"bytes,2,opt,name=buyer,proto3" json:"buyer,omitempty" yaml:"buyer"`
}

MsgBuyTickets represents the message to use to buy one or more lottery tickets.

func NewMsgBuyTickets

func NewMsgBuyTickets(quantity uint32, user string) *MsgBuyTickets

NewMsgBuyTickets allows to build a new MsgBuyTickets instance

func (*MsgBuyTickets) Descriptor

func (*MsgBuyTickets) Descriptor() ([]byte, []int)

func (*MsgBuyTickets) GetSignBytes

func (m *MsgBuyTickets) GetSignBytes() []byte

GetSignBytes implements sdk.Msg

func (*MsgBuyTickets) GetSigners

func (m *MsgBuyTickets) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgBuyTickets) Marshal

func (m *MsgBuyTickets) Marshal() (dAtA []byte, err error)

func (*MsgBuyTickets) MarshalTo

func (m *MsgBuyTickets) MarshalTo(dAtA []byte) (int, error)

func (*MsgBuyTickets) MarshalToSizedBuffer

func (m *MsgBuyTickets) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgBuyTickets) ProtoMessage

func (*MsgBuyTickets) ProtoMessage()

func (*MsgBuyTickets) Reset

func (m *MsgBuyTickets) Reset()

func (*MsgBuyTickets) Route

func (m *MsgBuyTickets) Route() string

Route implements sdk.Msg

func (*MsgBuyTickets) Size

func (m *MsgBuyTickets) Size() (n int)

func (*MsgBuyTickets) String

func (m *MsgBuyTickets) String() string

func (*MsgBuyTickets) Type

func (m *MsgBuyTickets) Type() string

Type implements sdk.Msg

func (*MsgBuyTickets) Unmarshal

func (m *MsgBuyTickets) Unmarshal(dAtA []byte) error

func (*MsgBuyTickets) ValidateBasic

func (m *MsgBuyTickets) ValidateBasic() error

ValidateBasic implements sdk.Msg

func (*MsgBuyTickets) XXX_DiscardUnknown

func (m *MsgBuyTickets) XXX_DiscardUnknown()

func (*MsgBuyTickets) XXX_Marshal

func (m *MsgBuyTickets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgBuyTickets) XXX_Merge

func (m *MsgBuyTickets) XXX_Merge(src proto.Message)

func (*MsgBuyTickets) XXX_Size

func (m *MsgBuyTickets) XXX_Size() int

func (*MsgBuyTickets) XXX_Unmarshal

func (m *MsgBuyTickets) XXX_Unmarshal(b []byte) error

type MsgBuyTicketsResponse

type MsgBuyTicketsResponse struct {
}

MsgBuyTicketsResponse defines the Msg/BuyTickets response type.

func (*MsgBuyTicketsResponse) Descriptor

func (*MsgBuyTicketsResponse) Descriptor() ([]byte, []int)

func (*MsgBuyTicketsResponse) Marshal

func (m *MsgBuyTicketsResponse) Marshal() (dAtA []byte, err error)

func (*MsgBuyTicketsResponse) MarshalTo

func (m *MsgBuyTicketsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgBuyTicketsResponse) MarshalToSizedBuffer

func (m *MsgBuyTicketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgBuyTicketsResponse) ProtoMessage

func (*MsgBuyTicketsResponse) ProtoMessage()

func (*MsgBuyTicketsResponse) Reset

func (m *MsgBuyTicketsResponse) Reset()

func (*MsgBuyTicketsResponse) Size

func (m *MsgBuyTicketsResponse) Size() (n int)

func (*MsgBuyTicketsResponse) String

func (m *MsgBuyTicketsResponse) String() string

func (*MsgBuyTicketsResponse) Unmarshal

func (m *MsgBuyTicketsResponse) Unmarshal(dAtA []byte) error

func (*MsgBuyTicketsResponse) XXX_DiscardUnknown

func (m *MsgBuyTicketsResponse) XXX_DiscardUnknown()

func (*MsgBuyTicketsResponse) XXX_Marshal

func (m *MsgBuyTicketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgBuyTicketsResponse) XXX_Merge

func (m *MsgBuyTicketsResponse) XXX_Merge(src proto.Message)

func (*MsgBuyTicketsResponse) XXX_Size

func (m *MsgBuyTicketsResponse) XXX_Size() int

func (*MsgBuyTicketsResponse) XXX_Unmarshal

func (m *MsgBuyTicketsResponse) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// BuyTickets defines the method to buy one or more lottery tickets
	BuyTickets(ctx context.Context, in *MsgBuyTickets, opts ...grpc.CallOption) (*MsgBuyTicketsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// BuyTickets defines the method to buy one or more lottery tickets
	BuyTickets(context.Context, *MsgBuyTickets) (*MsgBuyTicketsResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// Tickets queries all the stored tickets for the next draw
	Tickets(ctx context.Context, in *QueryTicketsRequest, opts ...grpc.CallOption) (*QueryTicketsResponse, error)
	// NextDraw queries the next planned drawn
	NextDraw(ctx context.Context, in *QueryNextDrawRequest, opts ...grpc.CallOption) (*QueryNextDrawResponse, error)
	// PastDraws queries the past draws that have already been drawn
	PastDraws(ctx context.Context, in *QueryPastDrawsRequest, opts ...grpc.CallOption) (*QueryPastDrawsResponse, error)
	// Params queries the wta parameters
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryNextDrawRequest

type QueryNextDrawRequest struct {
}

QueryDrawRequest is the request type for the Query/Draw RPC method.

func (*QueryNextDrawRequest) Descriptor

func (*QueryNextDrawRequest) Descriptor() ([]byte, []int)

func (*QueryNextDrawRequest) Marshal

func (m *QueryNextDrawRequest) Marshal() (dAtA []byte, err error)

func (*QueryNextDrawRequest) MarshalTo

func (m *QueryNextDrawRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryNextDrawRequest) MarshalToSizedBuffer

func (m *QueryNextDrawRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryNextDrawRequest) ProtoMessage

func (*QueryNextDrawRequest) ProtoMessage()

func (*QueryNextDrawRequest) Reset

func (m *QueryNextDrawRequest) Reset()

func (*QueryNextDrawRequest) Size

func (m *QueryNextDrawRequest) Size() (n int)

func (*QueryNextDrawRequest) String

func (m *QueryNextDrawRequest) String() string

func (*QueryNextDrawRequest) Unmarshal

func (m *QueryNextDrawRequest) Unmarshal(dAtA []byte) error

func (*QueryNextDrawRequest) XXX_DiscardUnknown

func (m *QueryNextDrawRequest) XXX_DiscardUnknown()

func (*QueryNextDrawRequest) XXX_Marshal

func (m *QueryNextDrawRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryNextDrawRequest) XXX_Merge

func (m *QueryNextDrawRequest) XXX_Merge(src proto.Message)

func (*QueryNextDrawRequest) XXX_Size

func (m *QueryNextDrawRequest) XXX_Size() int

func (*QueryNextDrawRequest) XXX_Unmarshal

func (m *QueryNextDrawRequest) XXX_Unmarshal(b []byte) error

type QueryNextDrawResponse

type QueryNextDrawResponse struct {
	Draw Draw `protobuf:"bytes,1,opt,name=draw,proto3" json:"draw"`
}

QueryDrawResponse is the response type for the Query/Draw RPC method

func (*QueryNextDrawResponse) Descriptor

func (*QueryNextDrawResponse) Descriptor() ([]byte, []int)

func (*QueryNextDrawResponse) GetDraw

func (m *QueryNextDrawResponse) GetDraw() Draw

func (*QueryNextDrawResponse) Marshal

func (m *QueryNextDrawResponse) Marshal() (dAtA []byte, err error)

func (*QueryNextDrawResponse) MarshalTo

func (m *QueryNextDrawResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryNextDrawResponse) MarshalToSizedBuffer

func (m *QueryNextDrawResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryNextDrawResponse) ProtoMessage

func (*QueryNextDrawResponse) ProtoMessage()

func (*QueryNextDrawResponse) Reset

func (m *QueryNextDrawResponse) Reset()

func (*QueryNextDrawResponse) Size

func (m *QueryNextDrawResponse) Size() (n int)

func (*QueryNextDrawResponse) String

func (m *QueryNextDrawResponse) String() string

func (*QueryNextDrawResponse) Unmarshal

func (m *QueryNextDrawResponse) Unmarshal(dAtA []byte) error

func (*QueryNextDrawResponse) XXX_DiscardUnknown

func (m *QueryNextDrawResponse) XXX_DiscardUnknown()

func (*QueryNextDrawResponse) XXX_Marshal

func (m *QueryNextDrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryNextDrawResponse) XXX_Merge

func (m *QueryNextDrawResponse) XXX_Merge(src proto.Message)

func (*QueryNextDrawResponse) XXX_Size

func (m *QueryNextDrawResponse) XXX_Size() int

func (*QueryNextDrawResponse) XXX_Unmarshal

func (m *QueryNextDrawResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	// Represents the parameters related to the prize distribution
	DistributionParams DistributionParams `protobuf:"bytes,1,opt,name=distribution_params,json=distributionParams,proto3" json:"distribution_params"`
	// Represents the parameters related to each draw
	DrawParams DrawParams `protobuf:"bytes,2,opt,name=draw_params,json=drawParams,proto3" json:"draw_params"`
	// Represents the parameters related to each ticket
	TicketParams TicketParams `protobuf:"bytes,3,opt,name=ticket_params,json=ticketParams,proto3" json:"ticket_params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetDistributionParams added in v0.1.1

func (m *QueryParamsResponse) GetDistributionParams() DistributionParams

func (*QueryParamsResponse) GetDrawParams added in v0.1.1

func (m *QueryParamsResponse) GetDrawParams() DrawParams

func (*QueryParamsResponse) GetTicketParams added in v0.1.1

func (m *QueryParamsResponse) GetTicketParams() TicketParams

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryPastDrawsRequest

type QueryPastDrawsRequest struct {
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryPastDrawsRequest is the request type for the Query/PastDraws RPC method.

func NewPastDrawsRequest

func NewPastDrawsRequest(pagination *query.PageRequest) *QueryPastDrawsRequest

NewPastDrawsRequest returns a new QueryPastDrawsRequest with the provided pagination data

func (*QueryPastDrawsRequest) Descriptor

func (*QueryPastDrawsRequest) Descriptor() ([]byte, []int)

func (*QueryPastDrawsRequest) GetPagination

func (m *QueryPastDrawsRequest) GetPagination() *query.PageRequest

func (*QueryPastDrawsRequest) Marshal

func (m *QueryPastDrawsRequest) Marshal() (dAtA []byte, err error)

func (*QueryPastDrawsRequest) MarshalTo

func (m *QueryPastDrawsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPastDrawsRequest) MarshalToSizedBuffer

func (m *QueryPastDrawsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPastDrawsRequest) ProtoMessage

func (*QueryPastDrawsRequest) ProtoMessage()

func (*QueryPastDrawsRequest) Reset

func (m *QueryPastDrawsRequest) Reset()

func (*QueryPastDrawsRequest) Size

func (m *QueryPastDrawsRequest) Size() (n int)

func (*QueryPastDrawsRequest) String

func (m *QueryPastDrawsRequest) String() string

func (*QueryPastDrawsRequest) Unmarshal

func (m *QueryPastDrawsRequest) Unmarshal(dAtA []byte) error

func (*QueryPastDrawsRequest) XXX_DiscardUnknown

func (m *QueryPastDrawsRequest) XXX_DiscardUnknown()

func (*QueryPastDrawsRequest) XXX_Marshal

func (m *QueryPastDrawsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPastDrawsRequest) XXX_Merge

func (m *QueryPastDrawsRequest) XXX_Merge(src proto.Message)

func (*QueryPastDrawsRequest) XXX_Size

func (m *QueryPastDrawsRequest) XXX_Size() int

func (*QueryPastDrawsRequest) XXX_Unmarshal

func (m *QueryPastDrawsRequest) XXX_Unmarshal(b []byte) error

type QueryPastDrawsResponse

type QueryPastDrawsResponse struct {
	Draws      []HistoricalDrawData `protobuf:"bytes,1,rep,name=draws,proto3" json:"draws"`
	Pagination *query.PageResponse  `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryPastDrawsResponse is the response type for the Query/PastDraws RPC method

func (*QueryPastDrawsResponse) Descriptor

func (*QueryPastDrawsResponse) Descriptor() ([]byte, []int)

func (*QueryPastDrawsResponse) GetDraws

func (*QueryPastDrawsResponse) GetPagination

func (m *QueryPastDrawsResponse) GetPagination() *query.PageResponse

func (*QueryPastDrawsResponse) Marshal

func (m *QueryPastDrawsResponse) Marshal() (dAtA []byte, err error)

func (*QueryPastDrawsResponse) MarshalTo

func (m *QueryPastDrawsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPastDrawsResponse) MarshalToSizedBuffer

func (m *QueryPastDrawsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPastDrawsResponse) ProtoMessage

func (*QueryPastDrawsResponse) ProtoMessage()

func (*QueryPastDrawsResponse) Reset

func (m *QueryPastDrawsResponse) Reset()

func (*QueryPastDrawsResponse) Size

func (m *QueryPastDrawsResponse) Size() (n int)

func (*QueryPastDrawsResponse) String

func (m *QueryPastDrawsResponse) String() string

func (*QueryPastDrawsResponse) Unmarshal

func (m *QueryPastDrawsResponse) Unmarshal(dAtA []byte) error

func (*QueryPastDrawsResponse) XXX_DiscardUnknown

func (m *QueryPastDrawsResponse) XXX_DiscardUnknown()

func (*QueryPastDrawsResponse) XXX_Marshal

func (m *QueryPastDrawsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPastDrawsResponse) XXX_Merge

func (m *QueryPastDrawsResponse) XXX_Merge(src proto.Message)

func (*QueryPastDrawsResponse) XXX_Size

func (m *QueryPastDrawsResponse) XXX_Size() int

func (*QueryPastDrawsResponse) XXX_Unmarshal

func (m *QueryPastDrawsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Tickets queries all the stored tickets for the next draw
	Tickets(context.Context, *QueryTicketsRequest) (*QueryTicketsResponse, error)
	// NextDraw queries the next planned drawn
	NextDraw(context.Context, *QueryNextDrawRequest) (*QueryNextDrawResponse, error)
	// PastDraws queries the past draws that have already been drawn
	PastDraws(context.Context, *QueryPastDrawsRequest) (*QueryPastDrawsResponse, error)
	// Params queries the wta parameters
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type QueryTicketsRequest

type QueryTicketsRequest struct {
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryTicketsRequest is the request type for the Query/Tickets RPC method.

func NewTicketsRequest

func NewTicketsRequest(pagination *query.PageRequest) *QueryTicketsRequest

NewTicketsRequest returns a new QueryTicketsRequest with the provided pagination data

func (*QueryTicketsRequest) Descriptor

func (*QueryTicketsRequest) Descriptor() ([]byte, []int)

func (*QueryTicketsRequest) GetPagination

func (m *QueryTicketsRequest) GetPagination() *query.PageRequest

func (*QueryTicketsRequest) Marshal

func (m *QueryTicketsRequest) Marshal() (dAtA []byte, err error)

func (*QueryTicketsRequest) MarshalTo

func (m *QueryTicketsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryTicketsRequest) MarshalToSizedBuffer

func (m *QueryTicketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTicketsRequest) ProtoMessage

func (*QueryTicketsRequest) ProtoMessage()

func (*QueryTicketsRequest) Reset

func (m *QueryTicketsRequest) Reset()

func (*QueryTicketsRequest) Size

func (m *QueryTicketsRequest) Size() (n int)

func (*QueryTicketsRequest) String

func (m *QueryTicketsRequest) String() string

func (*QueryTicketsRequest) Unmarshal

func (m *QueryTicketsRequest) Unmarshal(dAtA []byte) error

func (*QueryTicketsRequest) XXX_DiscardUnknown

func (m *QueryTicketsRequest) XXX_DiscardUnknown()

func (*QueryTicketsRequest) XXX_Marshal

func (m *QueryTicketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTicketsRequest) XXX_Merge

func (m *QueryTicketsRequest) XXX_Merge(src proto.Message)

func (*QueryTicketsRequest) XXX_Size

func (m *QueryTicketsRequest) XXX_Size() int

func (*QueryTicketsRequest) XXX_Unmarshal

func (m *QueryTicketsRequest) XXX_Unmarshal(b []byte) error

type QueryTicketsResponse

type QueryTicketsResponse struct {
	Tickets    []Ticket            `protobuf:"bytes,1,rep,name=tickets,proto3" json:"tickets"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryTicketsResponse is the response type for the Query/Tickets RPC method

func (*QueryTicketsResponse) Descriptor

func (*QueryTicketsResponse) Descriptor() ([]byte, []int)

func (*QueryTicketsResponse) GetPagination

func (m *QueryTicketsResponse) GetPagination() *query.PageResponse

func (*QueryTicketsResponse) GetTickets

func (m *QueryTicketsResponse) GetTickets() []Ticket

func (*QueryTicketsResponse) Marshal

func (m *QueryTicketsResponse) Marshal() (dAtA []byte, err error)

func (*QueryTicketsResponse) MarshalTo

func (m *QueryTicketsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryTicketsResponse) MarshalToSizedBuffer

func (m *QueryTicketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTicketsResponse) ProtoMessage

func (*QueryTicketsResponse) ProtoMessage()

func (*QueryTicketsResponse) Reset

func (m *QueryTicketsResponse) Reset()

func (*QueryTicketsResponse) Size

func (m *QueryTicketsResponse) Size() (n int)

func (*QueryTicketsResponse) String

func (m *QueryTicketsResponse) String() string

func (*QueryTicketsResponse) Unmarshal

func (m *QueryTicketsResponse) Unmarshal(dAtA []byte) error

func (*QueryTicketsResponse) XXX_DiscardUnknown

func (m *QueryTicketsResponse) XXX_DiscardUnknown()

func (*QueryTicketsResponse) XXX_Marshal

func (m *QueryTicketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTicketsResponse) XXX_Merge

func (m *QueryTicketsResponse) XXX_Merge(src proto.Message)

func (*QueryTicketsResponse) XXX_Size

func (m *QueryTicketsResponse) XXX_Size() int

func (*QueryTicketsResponse) XXX_Unmarshal

func (m *QueryTicketsResponse) XXX_Unmarshal(b []byte) error

type Ticket

type Ticket struct {
	Id        string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Owner     string    `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
}

Ticket represents a single entry for the next drawn

func MustUnmarshalTicket

func MustUnmarshalTicket(cdc codec.BinaryMarshaler, bz []byte) Ticket

MustUnmarshalTicket unmarshals the given byte slice into a Ticket object, and panics on error

func NewTicket

func NewTicket(id string, timestamp time.Time, owner string) Ticket

NewTicket allows to build a new Ticket instance.

func UnmarshalTicket

func UnmarshalTicket(cdc codec.BinaryMarshaler, bz []byte) (Ticket, error)

UnmarshalTicket reads the provided byte array as a Ticket object

func (*Ticket) Descriptor

func (*Ticket) Descriptor() ([]byte, []int)

func (*Ticket) Equal

func (this *Ticket) Equal(that interface{}) bool

func (*Ticket) GetId

func (m *Ticket) GetId() string

func (*Ticket) GetOwner

func (m *Ticket) GetOwner() string

func (*Ticket) GetTimestamp

func (m *Ticket) GetTimestamp() time.Time

func (*Ticket) Marshal

func (m *Ticket) Marshal() (dAtA []byte, err error)

func (*Ticket) MarshalTo

func (m *Ticket) MarshalTo(dAtA []byte) (int, error)

func (*Ticket) MarshalToSizedBuffer

func (m *Ticket) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Ticket) ProtoMessage

func (*Ticket) ProtoMessage()

func (*Ticket) Reset

func (m *Ticket) Reset()

func (*Ticket) Size

func (m *Ticket) Size() (n int)

func (*Ticket) String

func (m *Ticket) String() string

func (*Ticket) Unmarshal

func (m *Ticket) Unmarshal(dAtA []byte) error

func (*Ticket) Validate

func (t *Ticket) Validate() error

Validate returns an error if there is something wrong inside t

func (*Ticket) XXX_DiscardUnknown

func (m *Ticket) XXX_DiscardUnknown()

func (*Ticket) XXX_Marshal

func (m *Ticket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ticket) XXX_Merge

func (m *Ticket) XXX_Merge(src proto.Message)

func (*Ticket) XXX_Size

func (m *Ticket) XXX_Size() int

func (*Ticket) XXX_Unmarshal

func (m *Ticket) XXX_Unmarshal(b []byte) error

type TicketParams added in v0.1.1

type TicketParams struct {
	// Cost of an individual ticket
	Price types.Coin `protobuf:"bytes,5,opt,name=price,proto3" json:"price"`
}

TicketParams contain the parameters for each ticket

func DefaultTicketParams added in v0.1.1

func DefaultTicketParams() TicketParams

func NewTicketParams added in v0.1.1

func NewTicketParams(price sdk.Coin) TicketParams

func (*TicketParams) Descriptor added in v0.1.1

func (*TicketParams) Descriptor() ([]byte, []int)

func (*TicketParams) GetPrice added in v0.1.1

func (m *TicketParams) GetPrice() types.Coin

func (*TicketParams) Marshal added in v0.1.1

func (m *TicketParams) Marshal() (dAtA []byte, err error)

func (*TicketParams) MarshalTo added in v0.1.1

func (m *TicketParams) MarshalTo(dAtA []byte) (int, error)

func (*TicketParams) MarshalToSizedBuffer added in v0.1.1

func (m *TicketParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TicketParams) ProtoMessage added in v0.1.1

func (*TicketParams) ProtoMessage()

func (*TicketParams) Reset added in v0.1.1

func (m *TicketParams) Reset()

func (*TicketParams) Size added in v0.1.1

func (m *TicketParams) Size() (n int)

func (*TicketParams) String added in v0.1.1

func (m *TicketParams) String() string

func (*TicketParams) Unmarshal added in v0.1.1

func (m *TicketParams) Unmarshal(dAtA []byte) error

func (*TicketParams) XXX_DiscardUnknown added in v0.1.1

func (m *TicketParams) XXX_DiscardUnknown()

func (*TicketParams) XXX_Marshal added in v0.1.1

func (m *TicketParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TicketParams) XXX_Merge added in v0.1.1

func (m *TicketParams) XXX_Merge(src proto.Message)

func (*TicketParams) XXX_Size added in v0.1.1

func (m *TicketParams) XXX_Size() int

func (*TicketParams) XXX_Unmarshal added in v0.1.1

func (m *TicketParams) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) BuyTickets

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) NextDraw

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) PastDraws

func (*UnimplementedQueryServer) Tickets

Jump to

Keyboard shortcuts

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