Versions in this module Expand all Collapse all v0 v0.8.17 Sep 1, 2022 v0.8.16 Aug 31, 2022 Changes in this version + var ErrCommitDisabled = errors.New("no database for committing") + func AssertTrieConsistency(t testing.TB, root common.Hash, a, b *Database, ...) + func CorruptTrie(t *testing.T, trieDB *Database, root common.Hash, n int) + func FillAccounts(t *testing.T, trieDB *Database, root common.Hash, numAccounts int, ...) (common.Hash, map[*keystore.Key]*types.StateAccount) + func FillTrie(t *testing.T, numKeys int, keySize int, testTrie *Trie) ([][]byte, [][]byte) + func GenerateTrie(t *testing.T, trieDB *Database, numKeys int, keySize int) (common.Hash, [][]byte, [][]byte) + func VerifyProof(rootHash common.Hash, key []byte, proofDb ethdb.KeyValueReader) (value []byte, err error) + func VerifyRangeProof(rootHash common.Hash, firstKey []byte, lastKey []byte, keys [][]byte, ...) (bool, error) + type Config struct + Cache int + Preimages bool + type Database struct + func NewDatabase(diskdb ethdb.KeyValueStore) *Database + func NewDatabaseWithConfig(diskdb ethdb.KeyValueStore, config *Config) *Database + func (db *Database) Cap(limit common.StorageSize) error + func (db *Database) Commit(node common.Hash, report bool, callback func(common.Hash)) error + func (db *Database) Dereference(root common.Hash) + func (db *Database) DiskDB() ethdb.KeyValueStore + func (db *Database) EncodedNode(h common.Hash) node + func (db *Database) InsertPreimages(preimages map[string][]byte) + func (db *Database) Nodes() []common.Hash + func (db *Database) Preimage(hash common.Hash) []byte + func (db *Database) RawNode(h common.Hash) ([]byte, error) + func (db *Database) Reference(child common.Hash, parent common.Hash, exclusive bool) + func (db *Database) Size() (common.StorageSize, common.StorageSize) + func (db *Database) WritePreimages(limit common.StorageSize) 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(keys [][]byte, path []byte, leaf []byte, parent common.Hash, parentPath []byte) error + type MissingNodeError struct + NodeHash common.Hash + Owner common.Hash + Path []byte + func (err *MissingNodeError) Error() string + func (err *MissingNodeError) Unwrap() error + type NodeIterator interface + AddResolver func(ethdb.KeyValueReader) + Error func() error + Hash func() common.Hash + Leaf func() bool + LeafBlob func() []byte + LeafKey func() []byte + LeafProof func() [][]byte + Next func(bool) bool + NodeBlob func() []byte + Parent func() common.Hash + Path func() []byte + func NewDifferenceIterator(a, b NodeIterator) (NodeIterator, *int) + func NewUnionIterator(iters []NodeIterator) (NodeIterator, *int) + type SecureTrie struct + func NewSecure(owner common.Hash, root common.Hash, db *Database) (*SecureTrie, error) + func (t *SecureTrie) Commit(onleaf LeafCallback, referenceRoot bool) (common.Hash, int, 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 ethdb.KeyValueWriter) error + func (t *SecureTrie) TryDelete(key []byte) error + func (t *SecureTrie) TryGet(key []byte) ([]byte, error) + func (t *SecureTrie) TryGetNode(path []byte) ([]byte, int, error) + func (t *SecureTrie) TryUpdate(key, value []byte) error + func (t *SecureTrie) TryUpdateAccount(key []byte, acc *types.StateAccount) error + func (t *SecureTrie) Update(key, value []byte) + type StackTrie struct + func NewFromBinary(data []byte, db ethdb.KeyValueWriter) (*StackTrie, error) + func NewStackTrie(db ethdb.KeyValueWriter) *StackTrie + func NewStackTrieWithOwner(db ethdb.KeyValueWriter, owner common.Hash) *StackTrie + func (st *StackTrie) Commit() (h common.Hash, err error) + func (st *StackTrie) Hash() (h common.Hash) + func (st *StackTrie) MarshalBinary() (data []byte, err error) + func (st *StackTrie) Reset() + func (st *StackTrie) TryUpdate(key, value []byte) error + func (st *StackTrie) UnmarshalBinary(data []byte) error + func (st *StackTrie) Update(key, value []byte) + type Trie struct + func New(owner common.Hash, root common.Hash, db *Database) (*Trie, error) + func NewEmpty(db *Database) *Trie + func (t *Trie) Commit(onleaf LeafCallback, referenceRoot bool) (common.Hash, int, error) + func (t *Trie) Copy() *Trie + 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) Owner() common.Hash + func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) error + func (t *Trie) Reset() + func (t *Trie) TryDelete(key []byte) error + func (t *Trie) TryGet(key []byte) ([]byte, error) + func (t *Trie) TryGetNode(path []byte) ([]byte, int, error) + func (t *Trie) TryUpdate(key, value []byte) error + func (t *Trie) TryUpdateAccount(key []byte, acc *types.StateAccount) error + func (t *Trie) Update(key, value []byte)