Versions in this module Expand all Collapse all v0 v0.0.3 Feb 7, 2021 Changes in this version + var ErrAlreadyProcessed = errors.New("already processed") + var ErrNotRequested = errors.New("not requested") + func CacheMisses() int64 + func CacheUnloads() int64 + func VerifyProof(rootHash hash.Hash, key []byte, proofDb DatabaseReader) (value []byte, nodes int, err error) + type Database struct + func NewDatabase(diskdb statedb.Database) *Database + func (db *Database) Cap(limit common.StorageSize) error + func (db *Database) Commit(node hash.Hash, report bool) error + func (db *Database) Dereference(root hash.Hash) + func (db *Database) DiskDB() DatabaseReader + func (db *Database) InsertBlob(hash hash.Hash, blob []byte) + func (db *Database) Node(h hash.Hash) ([]byte, error) + func (db *Database) Nodes() []hash.Hash + func (db *Database) Reference(child hash.Hash, parent hash.Hash) + func (db *Database) Size() (common.StorageSize, common.StorageSize) + type DatabaseReader interface + Get func(key []byte) (value []byte, err error) + Has func(key []byte) (bool, error) + type Iterator struct + Err error + Key []byte + Value []byte + func NewIterator(it NodeIterator) *Iterator + func (it *Iterator) Next() bool + func (it *Iterator) Prove() [][]byte + type LeafCallback func(leaf []byte, parent hash.Hash) error + type MissingNodeError struct + NodeHash hash.Hash + Path []byte + func (err *MissingNodeError) Error() string + type NodeIterator interface + Error func() error + Hash func() hash.Hash + Leaf func() bool + LeafBlob func() []byte + LeafKey func() []byte + LeafProof func() [][]byte + Next func(bool) bool + Parent func() hash.Hash + Path func() []byte + func NewDifferenceIterator(a, b NodeIterator) (NodeIterator, *int) + func NewUnionIterator(iters []NodeIterator) (NodeIterator, *int) + type SecureTrie struct + func NewSecure(root hash.Hash, db *Database, cachelimit uint16) (*SecureTrie, error) + func (t *SecureTrie) Commit(onleaf LeafCallback) (root hash.Hash, err error) + func (t *SecureTrie) Copy() *SecureTrie + func (t *SecureTrie) Delete(key []byte) + func (t *SecureTrie) Get(key []byte) []byte + func (t *SecureTrie) GetKey(shaKey []byte) []byte + func (t *SecureTrie) Hash() hash.Hash + func (t *SecureTrie) NodeIterator(start []byte) NodeIterator + func (t *SecureTrie) Prove(key []byte, fromLevel uint, proofDb statedb.Putter) error + func (t *SecureTrie) Root() []byte + func (t *SecureTrie) TryDelete(key []byte) error + func (t *SecureTrie) TryGet(key []byte) ([]byte, error) + func (t *SecureTrie) TryUpdate(key, value []byte) error + func (t *SecureTrie) Update(key, value []byte) + type Sync struct + func NewSync(root hash.Hash, database DatabaseReader, callback LeafCallback) *Sync + func (s *Sync) AddRawEntry(h hash.Hash, depth int, parent hash.Hash) + func (s *Sync) AddSubTrie(root hash.Hash, depth int, parent hash.Hash, callback LeafCallback) + func (s *Sync) Commit(dbw statedb.Putter) (int, error) + func (s *Sync) Missing(max int) []hash.Hash + func (s *Sync) Pending() int + func (s *Sync) Process(results []SyncResult) (bool, int, error) + type SyncResult struct + Data []byte + Hash hash.Hash + type Trie struct + func New(root hash.Hash, db *Database) (*Trie, error) + func (t *Trie) Commit(onleaf LeafCallback) (root hash.Hash, err error) + func (t *Trie) Delete(key []byte) + func (t *Trie) Get(key []byte) []byte + func (t *Trie) Hash() hash.Hash + func (t *Trie) NodeIterator(start []byte) NodeIterator + func (t *Trie) Prove(key []byte, fromLevel uint, proofDb statedb.Putter) error + func (t *Trie) Root() []byte + func (t *Trie) SetCacheLimit(l uint16) + func (t *Trie) TryDelete(key []byte) error + func (t *Trie) TryGet(key []byte) ([]byte, error) + func (t *Trie) TryUpdate(key, value []byte) error + func (t *Trie) Update(key, value []byte)