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) 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) 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) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type JsonrpcMessage
- func (jm JsonrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string)
- func (cp JsonrpcMessage) GetMethod() string
- func (cp JsonrpcMessage) GetParams() interface{}
- func (jm *JsonrpcMessage) GetRawRequestHash() ([]byte, error)
- func (cp JsonrpcMessage) GetResult() json.RawMessage
- func (gm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error)
- func (cp JsonrpcMessage) ParseBlock(inp string) (int64, error)
- func (gm *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 (cp RestMessage) GetMethod() string
- func (cp RestMessage) GetParams() interface{}
- func (rm *RestMessage) GetRawRequestHash() ([]byte, error)
- func (cp RestMessage) GetResult() json.RawMessage
- func (cp RestMessage) ParseBlock(inp string) (int64, error)
- func (rm *RestMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool)
- type ServerSource
- type TendermintrpcMessage
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) 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) 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) 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) GetMethod ¶
func (cp JsonrpcMessage) GetMethod() string
func (JsonrpcMessage) GetParams ¶
func (cp 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 (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) 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) GetMethod ¶
func (cp RestMessage) GetMethod() string
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) 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 (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) 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 (cp TendermintrpcMessage) GetResult() json.RawMessage
func (TendermintrpcMessage) ParseBlock ¶
func (cp TendermintrpcMessage) ParseBlock(inp string) (int64, error)