trie

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN_NODE   NodeKind = "unknown"
	BRANCH_NODE    NodeKind = "TrieBranchNode"
	EXTENSION_NODE NodeKind = "TrieExtensionNode"
	LEAF_NODE      NodeKind = "TrieLeafNode"

	UNKNOWN_VALUE ValueKind = "unknown"
	TX_VALUE      ValueKind = "Transaction"
	RCT_VALUE     ValueKind = "Receipt"
	STATE_VALUE   ValueKind = "Account"
	STORAGE_VALUE ValueKind = "Bytes"
	LOG_VALUE     ValueKind = "Log"
)

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 eth merkle patricia trie nodes It's not possible to meet the Decode(na ipld.NodeAssembler, in io.Reader) interface for a function that supports all trie types (multicodec types), unlike with encoding. this is used by Decode functions for each trie 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 eth merkle patricia trie 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)

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