rpcInterfaceMessages

package
v0.32.6 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: Apache-2.0 Imports: 22 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 GenericMessage

type GenericMessage interface {
	GetHeaders() []pairingtypes.Metadata
	DisableErrorHandling()
}

type GrpcMessage

type GrpcMessage struct {
	Msg  []byte
	Path string

	Registry *dyncodec.Registry
	Codec    *dyncodec.Codec
	chainproxy.BaseMessage
	// 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)

func (*GrpcMessage) UpdateLatestBlockInMessage

func (gm *GrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)

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 JsonrpcBatchMessage

type JsonrpcBatchMessage struct {
	chainproxy.BaseMessage
	// contains filtered or unexported fields
}

func NewBatchMessage

func NewBatchMessage(msgs []JsonrpcMessage) (JsonrpcBatchMessage, error)

func (*JsonrpcBatchMessage) GetBatch

func (jbm *JsonrpcBatchMessage) GetBatch() []rpcclient.BatchElemWithId

func (*JsonrpcBatchMessage) UpdateLatestBlockInMessage

func (jbm *JsonrpcBatchMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)

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"`
	chainproxy.BaseMessage `json:"-"`
}

func ConvertBatchElement

func ConvertBatchElement(batchElement rpcclient.BatchElemWithId) (JsonrpcMessage, error)

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)

func (*JsonrpcMessage) UpdateLatestBlockInMessage

func (gm *JsonrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)

type ParsableRPCInput

type ParsableRPCInput struct {
	Result json.RawMessage
	chainproxy.BaseMessage
}

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
	chainproxy.BaseMessage
}

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

func (*RestMessage) UpdateLatestBlockInMessage

func (rm *RestMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)

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