types

package
v0.0.0-...-79a0367 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "greeter"

	// StoreKey is used to register the module's store
	StoreKey = ModuleName
)
View Source
const RouterKey = "greeter"

RouterKey is used to route messages and queriers to the greeter module

Variables

View Source
var (
	// ModuleCdc contains the types for the module that require encoding in amino
	ModuleCdc = codec.New()
)

Functions

This section is empty.

Types

type Greeting

type Greeting struct {
	Sender    sdk.AccAddress `json:"sender" yaml:"sender"`     // address of the account "sending" the greeting
	Recipient sdk.AccAddress `json:"receiver" yaml:"receiver"` // address of the account "receiving" the greeting
	Body      string         `json:"body" yaml:"body"`         // string body of the greeting
}

struct containing the data of the Greeting. json and yaml tags are used to specify field names when marshalled to json

func NewGreeting

func NewGreeting(sender sdk.AccAddress, body string, receiver sdk.AccAddress) Greeting

NewGreeting Returns a new Greeting

func (Greeting) String

func (g Greeting) String() string

implement fmt.Stringer

type GreetingsList

type GreetingsList []Greeting

GreetingsList stores all the greeting for a given address

type MsgGreet

type MsgGreet struct {
	Body      string         // content of the greeting
	Sender    sdk.AccAddress // account signing and sending the greeting
	Recipient sdk.AccAddress // account designated as recipient of the greeeting (not a signer)
}

MsgGreet defines the MsgGreet Message

func NewMsgGreet

func NewMsgGreet(sender sdk.AccAddress, body string, recipient sdk.AccAddress) MsgGreet

NewMsgGreet is a constructor function for MsgGreet

func (MsgGreet) GetSignBytes

func (msg MsgGreet) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgGreet) GetSigners

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

GetSigners returns the addresses of those required to sign the message

func (MsgGreet) Route

func (msg MsgGreet) Route() string

Route should return the name of the module

func (MsgGreet) Type

func (msg MsgGreet) Type() string

Type should return the action

func (MsgGreet) ValidateBasic

func (msg MsgGreet) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type QueryResGreetings

type QueryResGreetings map[string][]Greeting

QueryResGreetings defines the response to our Querier, containing greetings for a given address

func NewQueryResGreetings

func NewQueryResGreetings() QueryResGreetings

NewQueryResGreetings constructs a new instance

func (QueryResGreetings) String

func (q QueryResGreetings) String() string

Jump to

Keyboard shortcuts

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