types

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName        = "infrastructure"
	DefaultParamspace = ModuleName

	QuerierRoute = ModuleName

	RouteKey = "infrastructure"

	QueryContent = "content"
)

Variables

View Source
var (
	ErrInvalidEndPoint  = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInvalidEndPoint), "invalid endpoint")
	ErrCdcMarshaFailed  = sdkerrors.Register(string(DefaultCodespace), uint32(CodeCdcMarshalFailed), "cdc marshal failed")
	ErrGetContentFailed = sdkerrors.Register(string(DefaultCodespace), uint32(CodeGetContentFailed), "get content failed")
)
View Source
var (
	EventStoreContent string = "store_content"

	AttributeValueModule = "infrastructure"
	StoreKey             = "key"
)
View Source
var InfrastructureCdc *codec.Codec

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace sdk.CodespaceType = "infrastructure"

	CodeInvalidEndPoint  CodeType = 1901
	CodeCdcMarshalFailed CodeType = 1902
	CodeGetContentFailed CodeType = 1903
)

type GenesisState

type GenesisState struct {
	Data []StoredContent `json:"data"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

type MsgStoreContent

type MsgStoreContent struct {
	FromAddress sdk.AccAddress `json:"from_address"`
	Key         string         `json:"key"`
	Content     []byte         `json:"content"`
}

func NewMsgStoreContent

func NewMsgStoreContent(from sdk.AccAddress, key string, content []byte) MsgStoreContent

func (MsgStoreContent) Bytes

func (msg MsgStoreContent) Bytes() []byte

func (MsgStoreContent) GetFromAddress

func (msg MsgStoreContent) GetFromAddress() sdk.AccAddress

func (MsgStoreContent) MsgType

func (msg MsgStoreContent) MsgType() string

func (MsgStoreContent) Route

func (msg MsgStoreContent) Route() string

func (MsgStoreContent) ValidateBasic

func (msg MsgStoreContent) ValidateBasic() error

type QueryContentParams

type QueryContentParams struct {
	Key []byte `json:"key"`
}

func NewContentParams

func NewContentParams(key []byte) QueryContentParams

type StoredContent

type StoredContent struct {
	Key     string `json:"key"`
	Content string `json:"content"`
}

func NewStoredContent

func NewStoredContent(key, content string) StoredContent

Jump to

Keyboard shortcuts

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