record

package module
v0.0.0-...-2d5b52c Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "record"
)

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthRecord        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRecord          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRecord = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func GetRecordKey

func GetRecordKey(recordID []byte) []byte

GetRecordKey returns record key bytes

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Client

type Client interface {
	sdk.Module

	CreateRecord(request CreateRecordRequest, baseTx sdk.BaseTx) (string, sdk.Error)
	QueryRecord(request QueryRecordReq) (QueryRecordResp, sdk.Error)
}

expose Record module api for user

func NewClient

func NewClient(bc sdk.BaseClient, cdc codec.Marshaler) Client

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"`
	Meta       string `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"`
}

Content defines the detailed information for a record.

func (*Content) Descriptor

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

func (*Content) Equal

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

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 CreateRecordRequest

type CreateRecordRequest struct {
	Contents []Content
}

type Data

type Data struct {
	TxHash   string    `json:"tx_hash" yaml:"tx_hash"`
	Contents []Content `json:"contents" yaml:"contents"`
	Creator  string    `json:"creator" yaml:"creator"`
}

type MsgClient

type MsgClient interface {
	// CreateRecord defines a method for creating a new record.
	CreateRecord(ctx context.Context, in *MsgCreateRecord, opts ...grpc.CallOption) (*MsgCreateRecordResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgCreateRecord

type MsgCreateRecord struct {
	Contents []Content `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents"`
	Creator  string    `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
}

MsgCreateRecord defines an SDK message for creating a new record.

func (*MsgCreateRecord) Descriptor

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

func (*MsgCreateRecord) Equal

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

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 MsgCreateRecordResponse

type MsgCreateRecordResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}

MsgCreateRecordResponse defines the Msg/CreateRecord response type.

func (*MsgCreateRecordResponse) Descriptor

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

func (*MsgCreateRecordResponse) Marshal

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

func (*MsgCreateRecordResponse) MarshalTo

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

func (*MsgCreateRecordResponse) MarshalToSizedBuffer

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

func (*MsgCreateRecordResponse) ProtoMessage

func (*MsgCreateRecordResponse) ProtoMessage()

func (*MsgCreateRecordResponse) Reset

func (m *MsgCreateRecordResponse) Reset()

func (*MsgCreateRecordResponse) Size

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

func (*MsgCreateRecordResponse) String

func (m *MsgCreateRecordResponse) String() string

func (*MsgCreateRecordResponse) Unmarshal

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

func (*MsgCreateRecordResponse) XXX_DiscardUnknown

func (m *MsgCreateRecordResponse) XXX_DiscardUnknown()

func (*MsgCreateRecordResponse) XXX_Marshal

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

func (*MsgCreateRecordResponse) XXX_Merge

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

func (*MsgCreateRecordResponse) XXX_Size

func (m *MsgCreateRecordResponse) XXX_Size() int

func (*MsgCreateRecordResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// CreateRecord defines a method for creating a new record.
	CreateRecord(context.Context, *MsgCreateRecord) (*MsgCreateRecordResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// Record queries the record by the given record ID
	Record(ctx context.Context, in *QueryRecordRequest, opts ...grpc.CallOption) (*QueryRecordResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryRecordReq

type QueryRecordReq struct {
	RecordID string `json:"record_id"`
	Prove    bool   `json:"prove"`
	Height   int64  `json:"height"`
}

type QueryRecordRequest

type QueryRecordRequest struct {
	RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"`
}

QueryRecordRequest is the request type for the Query/Record RPC method

func (*QueryRecordRequest) Descriptor

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

func (*QueryRecordRequest) GetRecordId

func (m *QueryRecordRequest) GetRecordId() string

func (*QueryRecordRequest) Marshal

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

func (*QueryRecordRequest) MarshalTo

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

func (*QueryRecordRequest) MarshalToSizedBuffer

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

func (*QueryRecordRequest) ProtoMessage

func (*QueryRecordRequest) ProtoMessage()

func (*QueryRecordRequest) Reset

func (m *QueryRecordRequest) Reset()

func (*QueryRecordRequest) Size

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

func (*QueryRecordRequest) String

func (m *QueryRecordRequest) String() string

func (*QueryRecordRequest) Unmarshal

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

func (*QueryRecordRequest) XXX_DiscardUnknown

func (m *QueryRecordRequest) XXX_DiscardUnknown()

func (*QueryRecordRequest) XXX_Marshal

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

func (*QueryRecordRequest) XXX_Merge

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

func (*QueryRecordRequest) XXX_Size

func (m *QueryRecordRequest) XXX_Size() int

func (*QueryRecordRequest) XXX_Unmarshal

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

type QueryRecordResp

type QueryRecordResp struct {
	Record Data           `json:"record"`
	Proof  sdk.ProofValue `json:"proof"`
	Height int64          `json:"height"`
}

type QueryRecordResponse

type QueryRecordResponse struct {
	Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
}

QueryRecordResponse is the response type for the Query/Record RPC method

func (*QueryRecordResponse) Descriptor

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

func (*QueryRecordResponse) GetRecord

func (m *QueryRecordResponse) GetRecord() *Record

func (*QueryRecordResponse) Marshal

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

func (*QueryRecordResponse) MarshalTo

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

func (*QueryRecordResponse) MarshalToSizedBuffer

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

func (*QueryRecordResponse) ProtoMessage

func (*QueryRecordResponse) ProtoMessage()

func (*QueryRecordResponse) Reset

func (m *QueryRecordResponse) Reset()

func (*QueryRecordResponse) Size

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

func (*QueryRecordResponse) String

func (m *QueryRecordResponse) String() string

func (*QueryRecordResponse) Unmarshal

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

func (*QueryRecordResponse) XXX_DiscardUnknown

func (m *QueryRecordResponse) XXX_DiscardUnknown()

func (*QueryRecordResponse) XXX_Marshal

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

func (*QueryRecordResponse) XXX_Merge

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

func (*QueryRecordResponse) XXX_Size

func (m *QueryRecordResponse) XXX_Size() int

func (*QueryRecordResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Record queries the record by the given record ID
	Record(context.Context, *QueryRecordRequest) (*QueryRecordResponse, error)
}

QueryServer is the server API for Query service.

type Record

type Record struct {
	TxHash   string    `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty" yaml:"tx_hash"`
	Contents []Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents"`
	Creator  string    `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty"`
}

func (Record) Convert

func (this Record) Convert() interface{}

func (*Record) Descriptor

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

func (*Record) Equal

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

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 UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateRecord

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Record

Jump to

Keyboard shortcuts

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