cool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Cool module reserves error 400-499 lawl
	CodeIncorrectCoolAnswer sdk.CodeType = 400
)

Variables

This section is empty.

Functions

func ErrIncorrectCoolAnswer

func ErrIncorrectCoolAnswer(answer string) sdk.Error

ErrIncorrectCoolAnswer - Error returned upon an incorrect guess

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler returns a handler for "cool" type messages.

Types

type CoolGenesis

type CoolGenesis struct {
	Trend string `json:"trend"`
}

Genesis state - specify genesis trend

type Keeper

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

Keeper - handlers sets/gets of custom variables for your module

func NewKeeper

func NewKeeper(key sdk.StoreKey, bankKeeper bank.CoinKeeper) Keeper

NewKeeper - Returns the Keeper

func (Keeper) CheckTrend

func (k Keeper) CheckTrend(ctx sdk.Context, guessedTrend string) bool

CheckTrend - Returns true or false based on whether guessedTrend is currently cool or not

func (Keeper) GetTrend

func (k Keeper) GetTrend(ctx sdk.Context) string

GetTrend - returns the current cool trend

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data CoolGenesis) error

InitGenesis - store the genesis trend

type QuizMsg

type QuizMsg struct {
	Sender     sdk.Address
	CoolAnswer string
}

A message type to quiz how cool you are. these fields are can be entirely arbitrary and custom to your message

func NewQuizMsg

func NewQuizMsg(sender sdk.Address, coolerthancool string) QuizMsg

New cool message

func (QuizMsg) Get

func (msg QuizMsg) Get(key interface{}) (value interface{})

func (QuizMsg) GetSignBytes

func (msg QuizMsg) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (QuizMsg) GetSigners

func (msg QuizMsg) GetSigners() []sdk.Address

func (QuizMsg) String

func (msg QuizMsg) String() string

func (QuizMsg) Type

func (msg QuizMsg) Type() string

nolint

func (QuizMsg) ValidateBasic

func (msg QuizMsg) ValidateBasic() sdk.Error

Validate Basic is used to quickly disqualify obviously invalid messages quickly

type SetTrendMsg

type SetTrendMsg struct {
	Sender sdk.Address
	Cool   string
}

A really cool msg type, these fields are can be entirely arbitrary and custom to your message

func NewSetTrendMsg

func NewSetTrendMsg(sender sdk.Address, cool string) SetTrendMsg

New cool message

func (SetTrendMsg) Get

func (msg SetTrendMsg) Get(key interface{}) (value interface{})

func (SetTrendMsg) GetSignBytes

func (msg SetTrendMsg) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (SetTrendMsg) GetSigners

func (msg SetTrendMsg) GetSigners() []sdk.Address

func (SetTrendMsg) String

func (msg SetTrendMsg) String() string

func (SetTrendMsg) Type

func (msg SetTrendMsg) Type() string

nolint

func (SetTrendMsg) ValidateBasic

func (msg SetTrendMsg) ValidateBasic() sdk.Error

Validate Basic is used to quickly disqualify obviously invalid messages quickly

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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