record

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = "record"

	CodeInvalidDataSize        sdk.CodeType = 1
	CodeInvalidFileDescription sdk.CodeType = 2
	CodeInvalidDataHash        sdk.CodeType = 3
)
View Source
const (
	UploadLimitOfOnchain     = 1024 // Data field upload limit in bytes(1K currently)
	UploadLimitOfDescription = 1024 // Description field upload limit in bytes(1K currently)
)
View Source
const MsgType = "record"

name to idetify transaction types

Variables

This section is empty.

Functions

func ErrInvalidDataHash

func ErrInvalidDataHash(codespace sdk.CodespaceType, hash string) sdk.Error

func ErrInvalidDataSize

func ErrInvalidDataSize(codespace sdk.CodespaceType, limit int64) sdk.Error

func ErrInvalidDescription

func ErrInvalidDescription(codespace sdk.CodespaceType, limit int64) sdk.Error

func KeyRecord

func KeyRecord(dataHash string) []byte

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

Handle all "record" type messages.

func RegisterCodec added in v0.7.0

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Record Keeper

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, codespace sdk.CodespaceType) Keeper

NewKeeper returns a mapper that uses go-codec to (binary) encode and decode record types.

func (Keeper) AddRecord

func (keeper Keeper) AddRecord(ctx sdk.Context, msg MsgSubmitRecord)

func (Keeper) WireCodec

func (keeper Keeper) WireCodec() *codec.Codec

Returns the go-codec codec.

type MsgSubmitRecord

type MsgSubmitRecord struct {
	SubmitTime   int64          // File upload timestamp
	OwnerAddress sdk.AccAddress // Owner of file
	RecordID     string         // Record index ID
	Description  string         // Data/file description
	DataHash     string         // Data/file hash
	DataSize     int64          // Data/file Size in bytes
	Data         string         // Onchain data
}

----------------------------------------------------------- MsgSubmitRecord

func NewMsgSubmitRecord

func NewMsgSubmitRecord(description string,
	submitTime int64,
	ownerAddress sdk.AccAddress,
	dataHash string,
	dataSize int64,
	data string) MsgSubmitRecord

func (MsgSubmitRecord) Get

func (msg MsgSubmitRecord) Get(key interface{}) (value interface{})

Implements Msg.

func (MsgSubmitRecord) GetSignBytes

func (msg MsgSubmitRecord) GetSignBytes() []byte

Implements Msg.

func (MsgSubmitRecord) GetSigners

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

Implements Msg.

func (MsgSubmitRecord) Route added in v0.7.0

func (msg MsgSubmitRecord) Route() string

Implements Msg.

func (MsgSubmitRecord) String

func (msg MsgSubmitRecord) String() string

func (MsgSubmitRecord) Type

func (msg MsgSubmitRecord) Type() string

func (MsgSubmitRecord) ValidateBasic

func (msg MsgSubmitRecord) ValidateBasic() sdk.Error

Implements Msg.

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

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