les

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeList

type NodeList []rlp.RawValue

NodeList stores an ordered list of trie nodes. It implements ptndb.Putter.

func (NodeList) DataSize

func (n NodeList) DataSize() int

DataSize returns the aggregated data size of nodes in the list

func (NodeList) NodeSet

func (n NodeList) NodeSet() *NodeSet

NodeSet converts the node list to a NodeSet

func (*NodeList) Put

func (n *NodeList) Put(key []byte, value []byte) error

Put stores a new node at the end of the list

func (NodeList) Store

func (n NodeList) Store(db ptndb.Putter)

Store writes the contents of the list to the given database

type NodeSet

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

NodeSet stores a set of trie nodes. It implements trie.Database and can also act as a cache for another trie.Database.

func NewNodeSet

func NewNodeSet() *NodeSet

NewNodeSet creates an empty node set

func (*NodeSet) DataSize

func (db *NodeSet) DataSize() int

DataSize returns the aggregated data size of nodes in the set

func (*NodeSet) Get

func (db *NodeSet) Get(key []byte) ([]byte, error)

Get returns a stored node

func (*NodeSet) Has

func (db *NodeSet) Has(key []byte) (bool, error)

Has returns true if the node set contains the given key

func (*NodeSet) KeyCount

func (db *NodeSet) KeyCount() int

KeyCount returns the number of nodes in the set

func (*NodeSet) NodeList

func (db *NodeSet) NodeList() NodeList

NodeList converts the node set to a NodeList

func (*NodeSet) Put

func (db *NodeSet) Put(key []byte, value []byte) error

Put stores a new node in the set

func (*NodeSet) Store

func (db *NodeSet) Store(target ptndb.Putter)

Store writes the contents of the set to the given database

Jump to

Keyboard shortcuts

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