Versions in this module Expand all Collapse all v1 v1.1.0 Aug 14, 2019 v1.0.0 Jun 25, 2019 Changes in this version + var ErrAlreadyProcessed = errors.New("already processed") + var ErrNotRequested = errors.New("not requested") + var ErrZeroHashNode = errors.New("cannot retrieve a node which has 0x00 hash value") + func GetHashAndHexKey(key []byte) ([]byte, []byte) + func VerifyProof(rootHash common.Hash, key []byte, proofDB database.DBManager) (value []byte, err error, nodes int) + type Database struct + func NewDatabase(diskDB database.DBManager) *Database + func NewDatabaseWithCache(diskDB database.DBManager, cacheSize int) *Database + func (db *Database) Cap(limit common.StorageSize) error + func (db *Database) Commit(node common.Hash, report bool) error + func (db *Database) Dereference(root common.Hash) + func (db *Database) DiskDB() database.DBManager + func (db *Database) InsertBlob(hash common.Hash, blob []byte) + func (db *Database) Node(hash common.Hash) ([]byte, error) + func (db *Database) Nodes() []common.Hash + func (db *Database) Reference(child common.Hash, parent common.Hash) + func (db *Database) Size() (common.StorageSize, common.StorageSize) + func (db *Database) UpdateMetricNodes() + type DatabaseReader interface + Get func(key []byte) (value []byte, err error) + Has func(key []byte) (bool, error) + type DeriveShaOrig struct + func (d DeriveShaOrig) DeriveSha(list types.DerivableList) common.Hash + type Iterator struct + Err error + Key []byte + Value []byte + func NewIterator(it NodeIterator) *Iterator + func (it *Iterator) Next() bool + type LeafCallback func(leaf []byte, parent common.Hash) error + type MissingNodeError struct + NodeHash common.Hash + Path []byte + func (err *MissingNodeError) Error() string + type NodeIterator interface + Error func() error + Hash func() common.Hash + Leaf func() bool + LeafBlob func() []byte + LeafKey func() []byte + LeafProof func() [][]byte + Next func(bool) bool + Parent func() common.Hash + Path func() []byte + func NewDifferenceIterator(a, b NodeIterator) (NodeIterator, *int) + func NewUnionIterator(iters []NodeIterator) (NodeIterator, *int) + type SecureTrie struct + func NewSecureTrie(root common.Hash, db *Database) (*SecureTrie, error) + func (t *SecureTrie) Commit(onleaf LeafCallback) (root common.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() common.Hash + func (t *SecureTrie) NodeIterator(start []byte) NodeIterator + func (t *SecureTrie) Prove(key []byte, fromLevel uint, proofDB database.DBManager) error + 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) TryUpdateWithKeys(key, hashKey, hexKey, value []byte) error + func (t *SecureTrie) Update(key, value []byte) + type SyncResult struct + Data []byte + Hash common.Hash + type Trie struct + func NewTrie(root common.Hash, db *Database) (*Trie, error) + func (t *Trie) Commit(onleaf LeafCallback) (root common.Hash, err error) + func (t *Trie) Delete(key []byte) + func (t *Trie) Get(key []byte) []byte + func (t *Trie) Hash() common.Hash + func (t *Trie) NodeIterator(start []byte) NodeIterator + func (t *Trie) Prove(key []byte, fromLevel uint, proofDB database.DBManager) error + 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) TryUpdateWithHexKey(hexKey, value []byte) error + func (t *Trie) Update(key, value []byte) + type TrieSync struct + func NewTrieSync(root common.Hash, database database.DBManager, callback LeafCallback) *TrieSync + func (s *TrieSync) AddRawEntry(hash common.Hash, depth int, parent common.Hash) + func (s *TrieSync) AddSubTrie(root common.Hash, depth int, parent common.Hash, callback LeafCallback) + func (s *TrieSync) Commit(dbw database.Putter) (int, error) + func (s *TrieSync) Missing(max int) []common.Hash + func (s *TrieSync) Pending() int + func (s *TrieSync) Process(results []SyncResult) (bool, int, error)