mt

package
v0.0.0-...-c7417fd Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INNER_NODE NodeKind = "inner"
	LEAF_NODE  NodeKind = "leaf"

	UNKNOWN_VALUE   ValueKind = "unknown"
	VALIDATOR_VALUE ValueKind = "validator"
	EVIDENCE_VALUE  ValueKind = "evidence"
	TX_VALUE        ValueKind = "tx"
	COMMIT_VALUE    ValueKind = "commit"
	PART_VALUE      ValueKind = "part"
	RESULT_VALUE    ValueKind = "result"
	HEADER_VALUE    ValueKind = "header"
)

Variables

This section is empty.

Functions

func AppendEncode

func AppendEncode(enc []byte, inNode ipld.Node) ([]byte, error)

AppendEncode is like Encode, but it uses a destination buffer directly. This means less copying of bytes, and if the destination has enough capacity, fewer allocations.

func DecodeTrieNode

func DecodeTrieNode(na ipld.NodeAssembler, in io.Reader, codec uint64) error

DecodeTrieNode provides an IPLD codec decode interface for Tendermint Merkle tree nodes It's not possible to meet the Decode(na ipld.NodeAssembler, in io.Reader) interface for a function that supports all tree types (multicodec types), unlike with encoding. this is used by Decode functions for each tree type, which are the ones registered to their corresponding multicodec

func DecodeTrieNodeBytes

func DecodeTrieNodeBytes(na ipld.NodeAssembler, src []byte, codec uint64) error

DecodeTrieNodeBytes is like DecodeTrieNode, but it uses an input buffer directly.

func Encode

func Encode(node ipld.Node, w io.Writer) error

Encode provides an IPLD codec encode interface for Tendermint Merkle tree node IPLDs. This function is registered via the go-ipld-prime link loader for multicodec code XXXX when this package is invoked via init.

Types

type NodeKind

type NodeKind string

func NodeAndKind

func NodeAndKind(node ipld.Node) (ipld.Node, NodeKind, error)

NodeAndKind returns the node and its kind

func (NodeKind) String

func (n NodeKind) String() string

type ValueKind

type ValueKind string

func ValueAndKind

func ValueAndKind(node ipld.Node) (ipld.Node, ValueKind, error)

func (ValueKind) String

func (v ValueKind) String() string

Jump to

Keyboard shortcuts

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