Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrChildPosOutOfRange = errors.New("the position of the child is out of range")
ErrChildPosOutOfRange is raised when the position of a child in a branch node is less than 0 or greater than 16
var ErrEmptyNode = errors.New("the node is empty")
ErrEmptyNode is raised when we reach an empty node (a node with no children or no value)
var ErrInvalidEncoding = errors.New("cannot decode this invalid encoding")
ErrInvalidEncoding is raised when the encoded information cannot be decoded
var ErrInvalidNode = errors.New("invalid node")
ErrInvalidNode is raised when we reach an invalid node
var ErrNilDatabase = errors.New("no database provided")
ErrNilDatabase is raised when a database operation is called, but no database is provided
var ErrNilHasher = errors.New("no hasher provided")
ErrNilHasher is raised when the NewTrie() function is called, but a hasher isn't provided
var ErrNilMarshalizer = errors.New("no marshalizer provided")
ErrNilMarshalizer is raised when the NewTrie() function is called, but a marshalizer isn't provided
var ErrNilNode = errors.New("the node is nil")
ErrNilNode is raised when we reach a nil node
var ErrNodeNotFound = errors.New("the node is not present in the trie")
ErrNodeNotFound is raised when we try to get a node that is not present in the trie
var ErrValueTooShort = errors.New("cannot remove bytes from value because value is too short")
ErrValueTooShort is raised when we try to remove something from a value, and the value is too short
Functions ¶
func NewTrie ¶
func NewTrie(db data.DBWriteCacher, msh marshal.Marshalizer, hsh hashing.Hasher) (*patriciaMerkleTrie, error)
NewTrie creates a new Patricia Merkle Trie
Types ¶
This section is empty.