mpt

package
v0.0.0-...-4b38f8d Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullNode

type FullNode struct {
	Children [257]Node
	// contains filtered or unexported fields
}

func (*FullNode) CachedHash

func (n *FullNode) CachedHash() []byte

func (*FullNode) Hash

func (fn *FullNode) Hash() []byte

func (*FullNode) Save

func (fn *FullNode) Save(store storage.StorageAdapter)

func (*FullNode) Serialize

func (fn *FullNode) Serialize() []byte

type HashNode

type HashNode []byte

func (*HashNode) CachedHash

func (n *HashNode) CachedHash() []byte

func (*HashNode) Hash

func (hn *HashNode) Hash() []byte

func (*HashNode) Save

func (hn *HashNode) Save(store storage.StorageAdapter)

func (*HashNode) Serialize

func (hn *HashNode) Serialize() []byte

type Node

type Node interface {
	Hash() []byte
	CachedHash() []byte
	Serialize() []byte
	Save(storage.StorageAdapter)
}

func DeserializeNode

func DeserializeNode(data []byte) (Node, error)

type PersistNodeBase

type PersistNodeBase struct {
	Full  *PersistNodeFull  `cbor:"10,keyasint,omitempty"`
	Short *PersistNodeShort `cbor:"11,keyasint,omitempty"`
	Value *PersistNodeValue `cbor:"12,keyasint,omitempty"`
}

type PersistNodeFull

type PersistNodeFull struct {
	Children [][]byte
	// contains filtered or unexported fields
}

type PersistNodeShort

type PersistNodeShort struct {
	Key   []byte
	Value []byte
	// contains filtered or unexported fields
}

type PersistNodeValue

type PersistNodeValue []byte

type PersistTrie

type PersistTrie struct {
	Pairs []*PersistTriePair
	// contains filtered or unexported fields
}

type PersistTriePair

type PersistTriePair struct {
	Key   []byte
	Value []byte
	// contains filtered or unexported fields
}

type ShortNode

type ShortNode struct {
	Key   []byte
	Value Node
	// contains filtered or unexported fields
}

func (*ShortNode) CachedHash

func (n *ShortNode) CachedHash() []byte

func (*ShortNode) Hash

func (sn *ShortNode) Hash() []byte

func (*ShortNode) Save

func (sn *ShortNode) Save(store storage.StorageAdapter)

func (*ShortNode) Serialize

func (sn *ShortNode) Serialize() []byte

type Trie

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

func New

func New(root Node, store storage.StorageAdapter) *Trie

func (*Trie) Abort

func (t *Trie) Abort()

func (*Trie) Commit

func (t *Trie) Commit()

func (*Trie) Deserialize

func (t *Trie) Deserialize(data []byte) error

func (*Trie) Get

func (t *Trie) Get(key []byte) ([]byte, error)

func (*Trie) Put

func (t *Trie) Put(key, value []byte) error

func (*Trie) RootHash

func (t *Trie) RootHash() []byte

func (*Trie) Serialize

func (t *Trie) Serialize() ([]byte, error)

type ValueNode

type ValueNode struct {
	Value []byte
	// contains filtered or unexported fields
}

func (*ValueNode) CachedHash

func (n *ValueNode) CachedHash() []byte

func (*ValueNode) Hash

func (vn *ValueNode) Hash() []byte

func (*ValueNode) Save

func (vn *ValueNode) Save(store storage.StorageAdapter)

func (*ValueNode) Serialize

func (vn *ValueNode) Serialize() []byte

Jump to

Keyboard shortcuts

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