types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreateRecord = "create_record"
	AttributeKeyCreator   = "creator"
	AttributeKeyRecordID  = "record_id"

	AttributeValueCategory = ModuleName
)

record module event types

View Source
const (
	// module name
	ModuleName = "record"

	// StoreKey is the default store key for record
	StoreKey = ModuleName

	// RouterKey is the message route for record
	RouterKey = ModuleName

	// QuerierRoute is the querier route for the record store.
	QuerierRoute = StoreKey

	// Query endpoints supported by the record querier
	QueryRecord = "record"
)

nolint

View Source
const (
	TypeMsgCreateRecord = "create_record" // type for TypeMsgCreateRecord
)

Variables

View Source
var (
	RecordKey         = []byte{0x00} // record key
	IntraTxCounterKey = []byte{0x01} // key for intra-block tx index
)
View Source
var (
	ErrUnknownRecord = sdkerrors.Register(ModuleName, 1, "unknown record")
)

record module sentinel errors

View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func GetRecordKey

func GetRecordKey(recordID []byte) []byte

GetRecordKey returns record key bytes

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec.

Types

type Content

type Content struct {
	Digest     string `json:"digest" yaml:"digest"`
	DigestAlgo string `json:"digest_algo" yaml:"digest_algo"`
	URI        string `json:"uri" yaml:"uri"`
	Meta       string `json:"meta" yaml:"meta"`
}

Content represents a sub-record

type GenesisState

type GenesisState struct {
	Records []Record `json:"records"`
}

GenesisState - all record state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState gets raw genesis raw message for testing

func NewGenesisState

func NewGenesisState(records []Record) GenesisState

NewGenesisState constructs a GenesisState

type MsgCreateRecord

type MsgCreateRecord struct {
	Contents []Content
	Creator  sdk.AccAddress // the creator of the record
}

MsgCreateRecord - struct for create a record

func NewMsgCreateRecord

func NewMsgCreateRecord(contents []Content, Creator sdk.AccAddress) MsgCreateRecord

NewMsgCreateRecord constructs a MsgCreateRecord

func (MsgCreateRecord) GetSignBytes

func (msg MsgCreateRecord) GetSignBytes() []byte

GetSignBytes implements Msg.

func (MsgCreateRecord) GetSigners

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

GetSigners implements Msg.

func (MsgCreateRecord) Route

func (msg MsgCreateRecord) Route() string

Route implements Msg.

func (MsgCreateRecord) Type

func (msg MsgCreateRecord) Type() string

Type implements Msg.

func (MsgCreateRecord) ValidateBasic

func (msg MsgCreateRecord) ValidateBasic() error

ValidateBasic implements Msg.

type QueryRecordParams

type QueryRecordParams struct {
	RecordID []byte `json:"record_id"`
}

QueryRecordParams defines QueryRecord params

type Record

type Record struct {
	TxHash   bytes.HexBytes `json:"tx_hash" yaml:"tx_hash"`
	Contents []Content      `json:"contents" yaml:"contents"`
	Creator  sdk.AccAddress `json:"creator" yaml:"creator"`
}

Record represents a Record

func NewRecord

func NewRecord(txHash bytes.HexBytes, contents []Content, creator sdk.AccAddress) Record

NewRecord constructs a record

type RecordOutput

type RecordOutput struct {
	TxHash   string         `json:"tx_hash" yaml:"tx_hash"`
	Contents []Content      `json:"contents" yaml:"contents"`
	Creator  sdk.AccAddress `json:"creator" yaml:"creator"`
}

Jump to

Keyboard shortcuts

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