Documentation ¶
Index ¶
- Variables
- func CheckResponseErrorForJsonRpcBatch(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
- func ConvertErrorToRPCError(errString string, code int) *tenderminttypes.RPCError
- func ConvertToTendermintError(errString string, inputInfo []byte) string
- func DescriptorSourceFromServer(refClient *grpcreflect.Client) grpcurl.DescriptorSource
- func GetTendermintRPCError(jsonError *rpcclient.JsonError) (*tenderminttypes.RPCError, error)
- func IdFromRawMessage(rawID json.RawMessage) (jsonrpcId, error)
- func ParseSymbol(svcAndMethod string) (string, string)
- func ReflectionSupport(err error) error
- type GenericMessage
- type GrpcMessage
- func (jm GrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
- func (gm GrpcMessage) GetID() json.RawMessage
- func (gm GrpcMessage) GetMethod() string
- func (gm GrpcMessage) GetParams() interface{}
- func (gm *GrpcMessage) GetRawRequestHash() ([]byte, error)
- func (gm GrpcMessage) GetResult() json.RawMessage
- func (gm GrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)
- func (gm GrpcMessage) ParseBlock(inp string) (int64, error)
- func (gm *GrpcMessage) SetParsingData(methodDesc *desc.MethodDescriptor, formatter grpcurl.Formatter)
- func (gm *GrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
- func (gm *GrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type JSONRPCIntID
- type JSONRPCStringID
- type JsonrpcBatchMessage
- func (jbm *JsonrpcBatchMessage) GetBatch() []rpcclient.BatchElemWithId
- func (jbm JsonrpcBatchMessage) GetParams() interface{}
- func (jbm JsonrpcBatchMessage) GetRawRequestHash() ([]byte, error)
- func (jbm *JsonrpcBatchMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
- func (jbm *JsonrpcBatchMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type JsonrpcMessage
- func (jm JsonrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
- func (jm JsonrpcMessage) GetID() json.RawMessage
- func (jm JsonrpcMessage) GetMethod() string
- func (jm JsonrpcMessage) GetParams() interface{}
- func (jm *JsonrpcMessage) GetRawRequestHash() ([]byte, error)
- func (jm JsonrpcMessage) GetResult() json.RawMessage
- func (jm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)
- func (jm JsonrpcMessage) ParseBlock(inp string) (int64, error)
- func (jm *JsonrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
- func (jm *JsonrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type ParsableRPCInput
- type RPCResponse
- type RestMessage
- func (jm RestMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
- func (rm RestMessage) GetID() json.RawMessage
- func (rm RestMessage) GetMethod() string
- func (rm RestMessage) GetParams() interface{}
- func (rm *RestMessage) GetRawRequestHash() ([]byte, error)
- func (rm RestMessage) GetResult() json.RawMessage
- func (rm RestMessage) ParseBlock(inp string) (int64, error)
- func (rm *RestMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
- func (rm *RestMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type ServerSource
- type TendermintrpcMessage
- func (cp TendermintrpcMessage) GetParams() interface{}
- func (tm *TendermintrpcMessage) GetRawRequestHash() ([]byte, error)
- func (tm TendermintrpcMessage) GetResult() json.RawMessage
- func (tm TendermintrpcMessage) ParseBlock(inp string) (int64, error)
- func (tm TendermintrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
Constants ¶
This section is empty.
Variables ¶
var ErrFailedToConvertMessage = sdkerrors.New("RPC error", 1000, "failed to convert a message")
var WontCalculateBatchHash = sdkerrors.New("Wont calculate batch hash", 892, "wont calculate batch message hash") // on batches we just wont calculate hashes, meaning we wont retry.
Functions ¶
func CheckResponseErrorForJsonRpcBatch ¶
func CheckResponseErrorForJsonRpcBatch(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
returns if error exists and
func ConvertErrorToRPCError ¶
func ConvertErrorToRPCError(errString string, code int) *tenderminttypes.RPCError
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 ReflectionSupport ¶
Types ¶
type GenericMessage ¶
type GenericMessage interface { GetHeaders() []pairingtypes.Metadata DisableErrorHandling() GetParams() interface{} }
type GrpcMessage ¶
type GrpcMessage struct { Msg []byte Path string Registry *dyncodec.Registry Codec *dyncodec.Codec chainproxy.BaseMessage // contains filtered or unexported fields }
func (GrpcMessage) CheckResponseError ¶
func (jm GrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
func (GrpcMessage) GetID ¶
func (gm GrpcMessage) GetID() json.RawMessage
func (GrpcMessage) GetMethod ¶
func (gm GrpcMessage) GetMethod() string
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) GetRawRequestHash ¶
func (gm *GrpcMessage) GetRawRequestHash() ([]byte, error)
get msg hash byte array containing all the relevant information for a unique request. (headers / api / params)
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) SubscriptionIdExtractor ¶
func (gm *GrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
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) GetParams ¶
func (jbm JsonrpcBatchMessage) GetParams() interface{}
func (JsonrpcBatchMessage) GetRawRequestHash ¶
func (jbm JsonrpcBatchMessage) GetRawRequestHash() ([]byte, error)
on batches we don't want to calculate the batch hash as its impossible to get the args we will just return false so retry wont trigger.
func (*JsonrpcBatchMessage) SubscriptionIdExtractor ¶
func (jbm *JsonrpcBatchMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
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) CheckResponseError ¶
func (jm JsonrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
returns if error exists and
func (JsonrpcMessage) GetID ¶
func (jm JsonrpcMessage) GetID() json.RawMessage
func (JsonrpcMessage) GetMethod ¶
func (jm JsonrpcMessage) GetMethod() string
func (JsonrpcMessage) GetParams ¶
func (jm JsonrpcMessage) GetParams() interface{}
func (*JsonrpcMessage) GetRawRequestHash ¶
func (jm *JsonrpcMessage) GetRawRequestHash() ([]byte, error)
get msg hash byte array containing all the relevant information for a unique request. (headers / api / params)
func (JsonrpcMessage) GetResult ¶
func (jm JsonrpcMessage) GetResult() json.RawMessage
func (JsonrpcMessage) NewParsableRPCInput ¶
func (jm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)
func (JsonrpcMessage) ParseBlock ¶
func (jm JsonrpcMessage) ParseBlock(inp string) (int64, error)
func (*JsonrpcMessage) SubscriptionIdExtractor ¶
func (jm *JsonrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
func (*JsonrpcMessage) UpdateLatestBlockInMessage ¶
func (jm *JsonrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
type ParsableRPCInput ¶
type ParsableRPCInput struct { Result json.RawMessage chainproxy.BaseMessage }
func (ParsableRPCInput) GetID ¶
func (pri ParsableRPCInput) GetID() json.RawMessage
func (ParsableRPCInput) GetMethod ¶
func (pri ParsableRPCInput) GetMethod() string
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) CheckResponseError ¶
func (jm RestMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
func (RestMessage) GetID ¶
func (rm RestMessage) GetID() json.RawMessage
func (RestMessage) GetMethod ¶
func (rm RestMessage) GetMethod() string
func (RestMessage) GetParams ¶
func (rm RestMessage) GetParams() interface{}
GetParams will be deprecated after we remove old client Currently needed because of parser.RPCInput interface
func (*RestMessage) GetRawRequestHash ¶
func (rm *RestMessage) GetRawRequestHash() ([]byte, error)
get msg hash byte array containing all the relevant information for a unique request. (headers / api / params)
func (RestMessage) GetResult ¶
func (rm RestMessage) GetResult() json.RawMessage
GetResult will be deprecated after we remove old client Currently needed because of parser.RPCInput interface
func (RestMessage) ParseBlock ¶
func (rm RestMessage) ParseBlock(inp string) (int64, error)
ParseBlock parses default block number from string to int
func (*RestMessage) SubscriptionIdExtractor ¶
func (rm *RestMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string
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) GetRawRequestHash ¶
func (tm *TendermintrpcMessage) GetRawRequestHash() ([]byte, error)
get msg hash byte array containing all the relevant information for a unique request. (headers / api / params)
func (TendermintrpcMessage) GetResult ¶
func (tm TendermintrpcMessage) GetResult() json.RawMessage
func (TendermintrpcMessage) ParseBlock ¶
func (tm TendermintrpcMessage) ParseBlock(inp string) (int64, error)
func (TendermintrpcMessage) SubscriptionIdExtractor ¶
func (tm TendermintrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string