api

package
v0.0.0-...-f30a169 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 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 StatusCode_name = map[int32]string{
	0: "VALID",
	1: "INVALID",
}
View Source
var StatusCode_value = map[string]int32{
	"VALID":   0,
	"INVALID": 1,
}

Functions

func RegisterRpcForwarderServer

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

func RegisterRpcProverServer

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

Types

type ContractData

type ContractData struct {
	ContractName string    `protobuf:"bytes,1,opt,name=contract_name,json=contractName,proto3" json:"contract_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) GetContractName

func (m *ContractData) GetContractName() string

func (*ContractData) GetExtra

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

func (*ContractData) GetMethod

func (m *ContractData) GetMethod() 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 *TxValidationInfo, 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, *TxValidationInfo) (*TxValidationResponse, error)
}

RpcProverServer is the server API for RpcProver service.

type StatusCode

type StatusCode int32
const (
	StatusCode_VALID   StatusCode = 0
	StatusCode_INVALID StatusCode = 1
)

func (StatusCode) EnumDescriptor

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

func (StatusCode) String

func (x StatusCode) String() string

type TxValidationInfo

type TxValidationInfo struct {
	ChainId      string        `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	BlockHeight  uint64        `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	Index        int32         `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
	TxKey        string        `protobuf:"bytes,4,opt,name=tx_key,json=txKey,proto3" json:"tx_key,omitempty"`
	ContractData *ContractData `protobuf:"bytes,5,opt,name=ContractData,proto3" json:"ContractData,omitempty"`
	Extra        []byte        `protobuf:"bytes,6,opt,name=extra,proto3" json:"extra,omitempty"`
}

TxValidationInfo contains tx validation info

func (*TxValidationInfo) Descriptor

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

func (*TxValidationInfo) GetBlockHeight

func (m *TxValidationInfo) GetBlockHeight() uint64

func (*TxValidationInfo) GetChainId

func (m *TxValidationInfo) GetChainId() string

func (*TxValidationInfo) GetContractData

func (m *TxValidationInfo) GetContractData() *ContractData

func (*TxValidationInfo) GetExtra

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

func (*TxValidationInfo) GetIndex

func (m *TxValidationInfo) GetIndex() int32

func (*TxValidationInfo) GetTxKey

func (m *TxValidationInfo) GetTxKey() string

func (*TxValidationInfo) Marshal

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

func (*TxValidationInfo) MarshalTo

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

func (*TxValidationInfo) MarshalToSizedBuffer

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

func (*TxValidationInfo) ProtoMessage

func (*TxValidationInfo) ProtoMessage()

func (*TxValidationInfo) Reset

func (m *TxValidationInfo) Reset()

func (*TxValidationInfo) Size

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

func (*TxValidationInfo) String

func (m *TxValidationInfo) String() string

func (*TxValidationInfo) Unmarshal

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

func (*TxValidationInfo) XXX_DiscardUnknown

func (m *TxValidationInfo) XXX_DiscardUnknown()

func (*TxValidationInfo) XXX_Marshal

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

func (*TxValidationInfo) XXX_Merge

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

func (*TxValidationInfo) XXX_Size

func (m *TxValidationInfo) XXX_Size() int

func (*TxValidationInfo) XXX_Unmarshal

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

type TxValidationResponse

type TxValidationResponse struct {
	ChainId string     `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	TxKey   string     `protobuf:"bytes,2,opt,name=tx_key,json=txKey,proto3" json:"tx_key,omitempty"`
	Code    StatusCode `protobuf:"varint,3,opt,name=Code,proto3,enum=proto.StatusCode" 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() StatusCode

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