types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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{0x01} // record key
	IntraTxCounterKey = []byte{0x02} // key for intra-block tx index
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrUnknownRecord = sdkerrors.Register(ModuleName, 2, "unknown record")
)

record module sentinel errors

View Source
var (

	// ModuleCdc references the global x/staking module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/staking and
	// defined at the application level.
	ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry())
)

Functions

func GetRecordKey

func GetRecordKey(recordID []byte) []byte

GetRecordKey returns record key bytes

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the necessary x/staking interfaces and concrete types on the provided Amino codec. These types are used for Amino JSON serialization.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
}

AccountKeeper defines the expected account keeper for query account

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error
	LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type Content

type Content struct {
	Digest     string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	DigestAlgo string `protobuf:"bytes,2,opt,name=digest_algo,json=digestAlgo,proto3" json:"digest_algo,omitempty" yaml:"digest_algo"`
	URI        string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty" yaml:"uri"`
	Meta       string `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"`
}

Content defines a detail information for a record.

func (*Content) Descriptor

func (*Content) Descriptor() ([]byte, []int)

func (*Content) Equal

func (this *Content) Equal(that interface{}) bool

func (*Content) GetDigest

func (m *Content) GetDigest() string

func (*Content) GetDigestAlgo

func (m *Content) GetDigestAlgo() string

func (*Content) GetMeta

func (m *Content) GetMeta() string

func (*Content) GetURI

func (m *Content) GetURI() string

func (*Content) Marshal

func (m *Content) Marshal() (dAtA []byte, err error)

func (*Content) MarshalTo

func (m *Content) MarshalTo(dAtA []byte) (int, error)

func (*Content) MarshalToSizedBuffer

func (m *Content) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) Reset

func (m *Content) Reset()

func (*Content) Size

func (m *Content) Size() (n int)

func (*Content) String

func (m *Content) String() string

func (*Content) Unmarshal

func (m *Content) Unmarshal(dAtA []byte) error

func (*Content) XXX_DiscardUnknown

func (m *Content) XXX_DiscardUnknown()

func (*Content) XXX_Marshal

func (m *Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Content) XXX_Merge

func (m *Content) XXX_Merge(src proto.Message)

func (*Content) XXX_Size

func (m *Content) XXX_Size() int

func (*Content) XXX_Unmarshal

func (m *Content) XXX_Unmarshal(b []byte) error

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                                     `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents"`
	Creator  github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
}

MsgCreateValidator defines an SDK message for creating a new validator.

func NewMsgCreateRecord

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

NewMsgCreateRecord constructs a MsgCreateRecord

func (*MsgCreateRecord) Descriptor

func (*MsgCreateRecord) Descriptor() ([]byte, []int)

func (*MsgCreateRecord) Equal

func (this *MsgCreateRecord) Equal(that interface{}) bool

func (*MsgCreateRecord) GetContents

func (m *MsgCreateRecord) GetContents() []Content

func (*MsgCreateRecord) GetCreator

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) Marshal

func (m *MsgCreateRecord) Marshal() (dAtA []byte, err error)

func (*MsgCreateRecord) MarshalTo

func (m *MsgCreateRecord) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreateRecord) MarshalToSizedBuffer

func (m *MsgCreateRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreateRecord) ProtoMessage

func (*MsgCreateRecord) ProtoMessage()

func (*MsgCreateRecord) Reset

func (m *MsgCreateRecord) Reset()

func (MsgCreateRecord) Route

func (msg MsgCreateRecord) Route() string

Route implements Msg.

func (*MsgCreateRecord) Size

func (m *MsgCreateRecord) Size() (n int)

func (*MsgCreateRecord) String

func (m *MsgCreateRecord) String() string

func (MsgCreateRecord) Type

func (msg MsgCreateRecord) Type() string

Type implements Msg.

func (*MsgCreateRecord) Unmarshal

func (m *MsgCreateRecord) Unmarshal(dAtA []byte) error

func (MsgCreateRecord) ValidateBasic

func (msg MsgCreateRecord) ValidateBasic() error

ValidateBasic implements Msg.

func (*MsgCreateRecord) XXX_DiscardUnknown

func (m *MsgCreateRecord) XXX_DiscardUnknown()

func (*MsgCreateRecord) XXX_Marshal

func (m *MsgCreateRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreateRecord) XXX_Merge

func (m *MsgCreateRecord) XXX_Merge(src proto.Message)

func (*MsgCreateRecord) XXX_Size

func (m *MsgCreateRecord) XXX_Size() int

func (*MsgCreateRecord) XXX_Unmarshal

func (m *MsgCreateRecord) XXX_Unmarshal(b []byte) error

type QueryRecordParams

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

QueryRecordParams defines QueryRecord params

type Record

type Record struct {
	TxHash   github_com_tendermint_tendermint_libs_bytes.HexBytes `` /* 156-byte string literal not displayed */
	Contents []Content                                            `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents"`
	Creator  github_com_cosmos_cosmos_sdk_types.AccAddress        `protobuf:"bytes,3,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
}

func NewRecord

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

NewRecord constructs a record

func (*Record) Descriptor

func (*Record) Descriptor() ([]byte, []int)

func (*Record) Equal

func (this *Record) Equal(that interface{}) bool

func (*Record) GetContents

func (m *Record) GetContents() []Content

func (*Record) GetCreator

func (*Record) Marshal

func (m *Record) Marshal() (dAtA []byte, err error)

func (*Record) MarshalTo

func (m *Record) MarshalTo(dAtA []byte) (int, error)

func (*Record) MarshalToSizedBuffer

func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) Size

func (m *Record) Size() (n int)

func (*Record) String

func (m *Record) String() string

func (*Record) Unmarshal

func (m *Record) Unmarshal(dAtA []byte) error

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Record) XXX_Merge

func (m *Record) XXX_Merge(src proto.Message)

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

func (m *Record) XXX_Unmarshal(b []byte) error

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