rpcInterfaceMessages

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedToConvertMessage = sdkerrors.New("RPC error", 1000, "failed to convert a message")

Functions

func ConvertErrorToRPCError

func ConvertErrorToRPCError(errString string, code int) *tenderminttypes.RPCError

func ConvertToTendermintError

func ConvertToTendermintError(errString string, inputInfo []byte) string

func DescriptorSourceFromServer

func DescriptorSourceFromServer(refClient *grpcreflect.Client) grpcurl.DescriptorSource

func GetTendermintRPCError

func GetTendermintRPCError(jsonError *rpcclient.JsonError) (*tenderminttypes.RPCError, error)

func IdFromRawMessage

func IdFromRawMessage(rawID json.RawMessage) (jsonrpcId, error)

func ParseSymbol

func ParseSymbol(svcAndMethod string) (string, string)

func ReflectionSupport

func ReflectionSupport(err error) error

Types

type GrpcMessage

type GrpcMessage struct {
	Msg  []byte
	Path string

	Registry *dyncodec.Registry
	Codec    *dyncodec.Codec
	Header   []pairingtypes.Metadata
	// contains filtered or unexported fields
}

func (GrpcMessage) GetParams

func (gm GrpcMessage) GetParams() interface{}

GetParams will be deprecated after we remove old client Currently needed because of parser.RPCInput interface

func (GrpcMessage) GetResult

func (gm GrpcMessage) GetResult() json.RawMessage

GetResult will be deprecated after we remove old client Currently needed because of parser.RPCInput interface

func (GrpcMessage) NewParsableRPCInput

func (gm GrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)

func (GrpcMessage) ParseBlock

func (gm GrpcMessage) ParseBlock(inp string) (int64, error)

func (*GrpcMessage) SetParsingData

func (gm *GrpcMessage) SetParsingData(methodDesc *desc.MethodDescriptor, formatter grpcurl.Formatter)

type JSONRPCIntID

type JSONRPCIntID int

JSONRPCIntID a wrapper for JSON-RPC integer IDs

func (JSONRPCIntID) String

func (id JSONRPCIntID) String() string

type JSONRPCStringID

type JSONRPCStringID string

JSONRPCStringID a wrapper for JSON-RPC string IDs

func (JSONRPCStringID) String

func (id JSONRPCStringID) String() string

type JsonrpcMessage

type JsonrpcMessage struct {
	Version string               `json:"jsonrpc,omitempty"`
	ID      json.RawMessage      `json:"id,omitempty"`
	Method  string               `json:"method,omitempty"`
	Params  interface{}          `json:"params,omitempty"`
	Error   *rpcclient.JsonError `json:"error,omitempty"`
	Result  json.RawMessage      `json:"result,omitempty"`
}

func ConvertJsonRPCMsg

func ConvertJsonRPCMsg(rpcMsg *rpcclient.JsonrpcMessage) (*JsonrpcMessage, error)

func ParseJsonRPCMsg

func ParseJsonRPCMsg(data []byte) (msgRet *JsonrpcMessage, err error)

func (JsonrpcMessage) GetParams

func (cp JsonrpcMessage) GetParams() interface{}

func (JsonrpcMessage) GetResult

func (cp JsonrpcMessage) GetResult() json.RawMessage

func (JsonrpcMessage) NewParsableRPCInput

func (gm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)

func (JsonrpcMessage) ParseBlock

func (cp JsonrpcMessage) ParseBlock(inp string) (int64, error)

type ParsableRPCInput

type ParsableRPCInput struct {
	Result json.RawMessage
}

func (ParsableRPCInput) GetParams

func (pri ParsableRPCInput) GetParams() interface{}

func (ParsableRPCInput) GetResult

func (pri ParsableRPCInput) GetResult() json.RawMessage

func (ParsableRPCInput) ParseBlock

func (pri ParsableRPCInput) ParseBlock(inp string) (int64, error)

type RPCResponse

type RPCResponse struct {
	JSONRPC string                    `json:"jsonrpc"`
	ID      jsonrpcId                 `json:"id,omitempty"`
	Result  json.RawMessage           `json:"result,omitempty"`
	Error   *tenderminttypes.RPCError `json:"error,omitempty"`
}

func ConvertTendermintMsg

func ConvertTendermintMsg(rpcMsg *rpcclient.JsonrpcMessage) (*RPCResponse, error)

type RestMessage

type RestMessage struct {
	Msg      []byte
	Path     string
	SpecPath string
	Header   []pairingtypes.Metadata
}

func (RestMessage) GetParams

func (cp RestMessage) GetParams() interface{}

GetParams will be deprecated after we remove old client Currently needed because of parser.RPCInput interface

func (RestMessage) GetResult

func (cp RestMessage) GetResult() json.RawMessage

GetResult will be deprecated after we remove old client Currently needed because of parser.RPCInput interface

func (RestMessage) ParseBlock

func (cp RestMessage) ParseBlock(inp string) (int64, error)

ParseBlock parses default block number from string to int

type ServerSource

type ServerSource struct {
	Client *grpcreflect.Client
}

func (ServerSource) AllExtensionsForType

func (ss ServerSource) AllExtensionsForType(typeName string) ([]*desc.FieldDescriptor, error)

func (ServerSource) FindSymbol

func (ss ServerSource) FindSymbol(fullyQualifiedName string) (desc.Descriptor, error)

func (ServerSource) ListServices

func (ss ServerSource) ListServices() ([]string, error)

type TendermintrpcMessage

type TendermintrpcMessage struct {
	JsonrpcMessage
	Path string
}

func (TendermintrpcMessage) GetParams

func (cp TendermintrpcMessage) GetParams() interface{}

func (TendermintrpcMessage) GetResult

func (cp TendermintrpcMessage) GetResult() json.RawMessage

func (TendermintrpcMessage) ParseBlock

func (cp TendermintrpcMessage) ParseBlock(inp string) (int64, error)

Jump to

Keyboard shortcuts

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