parser

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARSE_PARAMS = 0
	PARSE_RESULT = 1

	MinimumHashLength = 32 // minimum hash length is 32 bits, which is MD5. SHA-1=40, SHA256=64, SHA512=128.
)

Variables

View Source
var ValueNotSetError = sdkerrors.New("Value Not Set ", 6662, "when trying to parse, the value that we attempted to parse did not exist")

Functions

func CapStringLen

func CapStringLen(inp string) string

func ParseBlockFromReply

func ParseBlockFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser) (int64, error)

func ParseDefaultBlockParameter

func ParseDefaultBlockParameter(block string) (int64, error)

func ParseFromReply

func ParseFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser) (string, error)

This returns the parsed response without decoding

func ParseFromReplyAndDecode

func ParseFromReplyAndDecode(rpcInput RPCInput, resultParser spectypes.BlockParser) (string, error)

This returns the parsed response after decoding

Types

type ParsedInput added in v2.4.0

type ParsedInput struct {
	// contains filtered or unexported fields
}

func NewParsedInput added in v2.4.0

func NewParsedInput() *ParsedInput

func ParseBlockFromParams

func ParseBlockFromParams(rpcInput RPCInput, blockParser spectypes.BlockParser, genericParsers []spectypes.GenericParser) *ParsedInput

func ParseWithGenericParsers added in v2.4.0

func ParseWithGenericParsers(rpcInput RPCInput, genericParsers []spectypes.GenericParser) (*ParsedInput, error)

func (*ParsedInput) GetBlock added in v2.4.0

func (p *ParsedInput) GetBlock() int64

func (*ParsedInput) GetBlockHashes added in v2.4.0

func (p *ParsedInput) GetBlockHashes() ([]string, error)

func (*ParsedInput) SetBlock added in v2.4.0

func (p *ParsedInput) SetBlock(block int64)

type RPCInput

type RPCInput interface {
	GetParams() interface{}
	GetResult() json.RawMessage
	ParseBlock(block string) (int64, error)
	GetHeaders() []pairingtypes.Metadata
	GetMethod() string
	GetID() json.RawMessage
}

Jump to

Keyboard shortcuts

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