cool

package
v0.26.0-iris Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = 6

	// 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 added in v0.16.0

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 added in v0.25.0

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

Types

type Genesis added in v0.16.0

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

genesis state - specify genesis trend

func ExportGenesis added in v0.26.0

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 added in v0.16.0

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 added in v0.16.0

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

New cool message

func (MsgQuiz) GetSignBytes added in v0.16.0

func (msg MsgQuiz) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (MsgQuiz) GetSigners added in v0.16.0

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

func (MsgQuiz) Route added in v0.25.0

func (msg MsgQuiz) Route() string

nolint

func (MsgQuiz) String added in v0.16.0

func (msg MsgQuiz) String() string

func (MsgQuiz) Type added in v0.16.0

func (msg MsgQuiz) Type() string

func (MsgQuiz) ValidateBasic added in v0.16.0

func (msg MsgQuiz) ValidateBasic() sdk.Error

Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgSetTrend added in v0.16.0

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 added in v0.16.0

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

new cool message

func (MsgSetTrend) GetSignBytes added in v0.16.0

func (msg MsgSetTrend) GetSignBytes() []byte

Get the bytes for the message signer to sign on

func (MsgSetTrend) GetSigners added in v0.16.0

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

func (MsgSetTrend) Route added in v0.25.0

func (msg MsgSetTrend) Route() string

nolint

func (MsgSetTrend) String added in v0.16.0

func (msg MsgSetTrend) String() string

func (MsgSetTrend) Type added in v0.16.0

func (msg MsgSetTrend) Type() string

func (MsgSetTrend) ValidateBasic added in v0.16.0

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