cool

package
v0.27.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = "cool"

	// Cool module reserves error 400-499 lawl
	CodeIncorrectCoolAnswer sdk.CodeType = 400
)

Cool errors reserve 400 ~ 499.

Variables

This section is empty.

Functions

func ErrIncorrectCoolAnswer

func ErrIncorrectCoolAnswer(codespace sdk.CodespaceType, answer string) sdk.Error

ErrIncorrectCoolAnswer - Error returned upon an incorrect guess

func InitGenesis

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

InitGenesis - store the genesis trend

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler returns a handler for "cool" type messages.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

Types

type Genesis

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

genesis state - specify genesis trend

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) Genesis

ExportGenesis - output the 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.Keeper, codespace sdk.CodespaceType) 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

type MsgQuiz

type MsgQuiz struct {
	Sender     sdk.AccAddress
	CoolAnswer string
}

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

func NewMsgQuiz

func NewMsgQuiz(sender sdk.AccAddress, coolerthancool string) MsgQuiz

New cool message

func (MsgQuiz) GetSignBytes

func (msg MsgQuiz) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (MsgQuiz) GetSigners

func (msg MsgQuiz) GetSigners() []sdk.AccAddress

func (MsgQuiz) Route

func (msg MsgQuiz) Route() string

nolint

func (MsgQuiz) String

func (msg MsgQuiz) String() string

func (MsgQuiz) Type

func (msg MsgQuiz) Type() string

func (MsgQuiz) ValidateBasic

func (msg MsgQuiz) ValidateBasic() sdk.Error

Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgSetTrend

type MsgSetTrend struct {
	Sender sdk.AccAddress
	Cool   string
}

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

func NewMsgSetTrend

func NewMsgSetTrend(sender sdk.AccAddress, cool string) MsgSetTrend

new cool message

func (MsgSetTrend) GetSignBytes

func (msg MsgSetTrend) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (MsgSetTrend) GetSigners

func (msg MsgSetTrend) GetSigners() []sdk.AccAddress

func (MsgSetTrend) Route

func (msg MsgSetTrend) Route() string

nolint

func (MsgSetTrend) String

func (msg MsgSetTrend) String() string

func (MsgSetTrend) Type

func (msg MsgSetTrend) Type() string

func (MsgSetTrend) ValidateBasic

func (msg MsgSetTrend) ValidateBasic() sdk.Error

Validate Basic is used to quickly disqualify obviously invalid messages quickly

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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