api

package
v2.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSpvProver        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSpvProver          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSpvProver = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Code_name = map[int32]string{
	0: "Unknown",
	1: "Valid",
	2: "Invalid",
}
View Source
var Code_value = map[string]int32{
	"Unknown": 0,
	"Valid":   1,
	"Invalid": 2,
}

Functions

func RegisterRpcForwarderServer

func RegisterRpcForwarderServer(s *grpc.Server, srv RpcForwarderServer)

func RegisterRpcProverServer

func RegisterRpcProverServer(s *grpc.Server, srv RpcProverServer)

Types

type Code

type Code int32
const (
	Code_Unknown Code = 0
	Code_Valid   Code = 1
	Code_Invalid Code = 2
)

func (Code) EnumDescriptor

func (Code) EnumDescriptor() ([]byte, []int)

func (Code) String

func (x Code) String() string

type ContractData

type ContractData struct {
	Name    string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version string    `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Method  string    `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
	Params  []*KVPair `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"`
	Extra   []byte    `protobuf:"bytes,5,opt,name=extra,proto3" json:"extra,omitempty"`
}

ContractData contains contract data in the tx

func (*ContractData) Descriptor

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

func (*ContractData) GetExtra

func (m *ContractData) GetExtra() []byte

func (*ContractData) GetMethod

func (m *ContractData) GetMethod() string

func (*ContractData) GetName

func (m *ContractData) GetName() string

func (*ContractData) GetParams

func (m *ContractData) GetParams() []*KVPair

func (*ContractData) GetVersion

func (m *ContractData) GetVersion() string

func (*ContractData) Marshal

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

func (*ContractData) MarshalTo

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

func (*ContractData) MarshalToSizedBuffer

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

func (*ContractData) ProtoMessage

func (*ContractData) ProtoMessage()

func (*ContractData) Reset

func (m *ContractData) Reset()

func (*ContractData) Size

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

func (*ContractData) String

func (m *ContractData) String() string

func (*ContractData) Unmarshal

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

func (*ContractData) XXX_DiscardUnknown

func (m *ContractData) XXX_DiscardUnknown()

func (*ContractData) XXX_Marshal

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

func (*ContractData) XXX_Merge

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

func (*ContractData) XXX_Size

func (m *ContractData) XXX_Size() int

func (*ContractData) XXX_Unmarshal

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

type KVPair

type KVPair struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*KVPair) Descriptor

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

func (*KVPair) GetKey

func (m *KVPair) GetKey() string

func (*KVPair) GetValue

func (m *KVPair) GetValue() []byte

func (*KVPair) Marshal

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

func (*KVPair) MarshalTo

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

func (*KVPair) MarshalToSizedBuffer

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

func (*KVPair) ProtoMessage

func (*KVPair) ProtoMessage()

func (*KVPair) Reset

func (m *KVPair) Reset()

func (*KVPair) Size

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

func (*KVPair) String

func (m *KVPair) String() string

func (*KVPair) Unmarshal

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

func (*KVPair) XXX_DiscardUnknown

func (m *KVPair) XXX_DiscardUnknown()

func (*KVPair) XXX_Marshal

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

func (*KVPair) XXX_Merge

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

func (*KVPair) XXX_Size

func (m *KVPair) XXX_Size() int

func (*KVPair) XXX_Unmarshal

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

type RpcForwarderClient

type RpcForwarderClient interface {
	// processing transaction message requests
	ForwardRequest(ctx context.Context, in *cm_pbgo.TxRequest, opts ...grpc.CallOption) (*cm_pbgo.TxResponse, error)
}

RpcForwarderClient is the client API for RpcForwarder service.

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

func NewRpcForwarderClient

func NewRpcForwarderClient(cc *grpc.ClientConn) RpcForwarderClient

type RpcForwarderServer

type RpcForwarderServer interface {
	// processing transaction message requests
	ForwardRequest(context.Context, *cm_pbgo.TxRequest) (*cm_pbgo.TxResponse, error)
}

RpcForwarderServer is the server API for RpcForwarder service.

type RpcProverClient

type RpcProverClient interface {
	// verify the validation of transaction
	ValidTransaction(ctx context.Context, in *TxValidationRequest, opts ...grpc.CallOption) (*TxValidationResponse, error)
}

RpcProverClient is the client API for RpcProver service.

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

func NewRpcProverClient

func NewRpcProverClient(cc *grpc.ClientConn) RpcProverClient

type RpcProverServer

type RpcProverServer interface {
	// verify the validation of transaction
	ValidTransaction(context.Context, *TxValidationRequest) (*TxValidationResponse, error)
}

RpcProverServer is the server API for RpcProver service.

type TxValidationRequest

type TxValidationRequest struct {
	ChainId      string        `protobuf:"bytes,1,opt,name=chainId,proto3" json:"chainId,omitempty"`
	BlockHeight  uint64        `protobuf:"varint,2,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"`
	Index        int64         `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
	TxKey        string        `protobuf:"bytes,4,opt,name=txKey,proto3" json:"txKey,omitempty"`
	ContractData *ContractData `protobuf:"bytes,5,opt,name=contractData,proto3" json:"contractData,omitempty"`
	Timeout      int64         `protobuf:"varint,6,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Extra        []byte        `protobuf:"bytes,7,opt,name=extra,proto3" json:"extra,omitempty"`
}

TxValidationRequest contains tx validation info

func (*TxValidationRequest) Descriptor

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

func (*TxValidationRequest) GetBlockHeight

func (m *TxValidationRequest) GetBlockHeight() uint64

func (*TxValidationRequest) GetChainId

func (m *TxValidationRequest) GetChainId() string

func (*TxValidationRequest) GetContractData

func (m *TxValidationRequest) GetContractData() *ContractData

func (*TxValidationRequest) GetExtra

func (m *TxValidationRequest) GetExtra() []byte

func (*TxValidationRequest) GetIndex

func (m *TxValidationRequest) GetIndex() int64

func (*TxValidationRequest) GetTimeout

func (m *TxValidationRequest) GetTimeout() int64

func (*TxValidationRequest) GetTxKey

func (m *TxValidationRequest) GetTxKey() string

func (*TxValidationRequest) Marshal

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

func (*TxValidationRequest) MarshalTo

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

func (*TxValidationRequest) MarshalToSizedBuffer

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

func (*TxValidationRequest) ProtoMessage

func (*TxValidationRequest) ProtoMessage()

func (*TxValidationRequest) Reset

func (m *TxValidationRequest) Reset()

func (*TxValidationRequest) Size

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

func (*TxValidationRequest) String

func (m *TxValidationRequest) String() string

func (*TxValidationRequest) Unmarshal

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

func (*TxValidationRequest) XXX_DiscardUnknown

func (m *TxValidationRequest) XXX_DiscardUnknown()

func (*TxValidationRequest) XXX_Marshal

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

func (*TxValidationRequest) XXX_Merge

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

func (*TxValidationRequest) XXX_Size

func (m *TxValidationRequest) XXX_Size() int

func (*TxValidationRequest) XXX_Unmarshal

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

type TxValidationResponse

type TxValidationResponse struct {
	ChainId string `protobuf:"bytes,1,opt,name=chainId,proto3" json:"chainId,omitempty"`
	TxKey   string `protobuf:"bytes,2,opt,name=txKey,proto3" json:"txKey,omitempty"`
	Code    Code   `protobuf:"varint,3,opt,name=code,proto3,enum=proto.Code" json:"code,omitempty"`
	Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
}

TxValidationResponse is the tx validation result

func (*TxValidationResponse) Descriptor

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

func (*TxValidationResponse) GetChainId

func (m *TxValidationResponse) GetChainId() string

func (*TxValidationResponse) GetCode

func (m *TxValidationResponse) GetCode() Code

func (*TxValidationResponse) GetMessage

func (m *TxValidationResponse) GetMessage() string

func (*TxValidationResponse) GetTxKey

func (m *TxValidationResponse) GetTxKey() string

func (*TxValidationResponse) Marshal

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

func (*TxValidationResponse) MarshalTo

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

func (*TxValidationResponse) MarshalToSizedBuffer

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

func (*TxValidationResponse) ProtoMessage

func (*TxValidationResponse) ProtoMessage()

func (*TxValidationResponse) Reset

func (m *TxValidationResponse) Reset()

func (*TxValidationResponse) Size

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

func (*TxValidationResponse) String

func (m *TxValidationResponse) String() string

func (*TxValidationResponse) Unmarshal

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

func (*TxValidationResponse) XXX_DiscardUnknown

func (m *TxValidationResponse) XXX_DiscardUnknown()

func (*TxValidationResponse) XXX_Marshal

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

func (*TxValidationResponse) XXX_Merge

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

func (*TxValidationResponse) XXX_Size

func (m *TxValidationResponse) XXX_Size() int

func (*TxValidationResponse) XXX_Unmarshal

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

type UnimplementedRpcForwarderServer

type UnimplementedRpcForwarderServer struct {
}

UnimplementedRpcForwarderServer can be embedded to have forward compatible implementations.

func (*UnimplementedRpcForwarderServer) ForwardRequest

type UnimplementedRpcProverServer

type UnimplementedRpcProverServer struct {
}

UnimplementedRpcProverServer can be embedded to have forward compatible implementations.

func (*UnimplementedRpcProverServer) ValidTransaction

Jump to

Keyboard shortcuts

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