decoder

package
v0.0.3-rc-1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChildrenCapacity is the maximum number of children in a branch node.
	ChildrenCapacity = 16
)

Variables

View Source
var (
	// ErrDecodeStorageValue is defined since no sentinel error is defined
	// in the scale package.
	ErrDecodeStorageValue        = errors.New("cannot decode storage value")
	ErrDecodeHashedStorageValue  = errors.New("cannot decode hashed storage value")
	ErrDecodeHashedValueTooShort = errors.New("hashed storage value too short")
	ErrReadChildrenBitmap        = errors.New("cannot read children bitmap")
	// ErrDecodeChildHash is defined since no sentinel error is defined
	// in the scale package.
	ErrDecodeChildHash = errors.New("cannot decode child hash")
)
View Source
var (
	ErrPartialKeyTooBig = errors.New("partial key length cannot be larger than 2^16")
)
View Source
var ErrReaderMismatchCount = errors.New("read unexpected number of bytes from reader")
View Source
var ErrVariantUnknown = errors.New("node variant is unknown")

Functions

func DecodeNode

func DecodeNode(reader *bytes.Buffer) (n *node.Node, err error)

TODO: move in another folder DecodeNode decodes a node from a reader. The encoding format is documented in the README.md of this package, and specified in the Polkadot spec at https://spec.polkadot.network/#sect-state-storage For branch decoding, see the comments on decodeBranch. For leaf decoding, see the comments on decodeLeaf.

Types

This section is empty.

Jump to

Keyboard shortcuts

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