Versions in this module Expand all Collapse all v0 v0.1.0 Apr 21, 2023 Changes in this version + func CopyTrie(nodeHash []byte, storage Storage, newStorage Storage, agg []byte, ...) error + func HashChecker(stateRoot []byte, storage Storage) (types.Hash, error) + type Batch interface + Put func(k, v []byte) + Write func() + type FullNode struct + func (c *FullNode) Hash() ([]byte, bool) + func (c *FullNode) SetHash(b []byte) []byte + type KVBatch struct + func (b *KVBatch) Put(k, v []byte) + func (b *KVBatch) Write() + type KVStorage struct + func NewKV(db *leveldb.DB) *KVStorage + func (kv *KVStorage) Batch() Batch + func (kv *KVStorage) Close() error + func (kv *KVStorage) Get(k []byte) ([]byte, bool) + func (kv *KVStorage) GetCode(hash types.Hash) ([]byte, bool) + func (kv *KVStorage) Put(k, v []byte) + func (kv *KVStorage) SetCode(hash types.Hash, code []byte) + type Node interface + Hash func() ([]byte, bool) + SetHash func(b []byte) []byte + func GetNode(root []byte, storage Storage) (Node, bool, error) + type Putter interface + Put func(k, v []byte) + type ShortNode struct + func (c *ShortNode) Hash() ([]byte, bool) + func (c *ShortNode) SetHash(b []byte) []byte + type Snapshot struct + func (s *Snapshot) Commit(objs []*state.Object) (state.Snapshot, []byte) + func (s *Snapshot) GetAccount(addr types.Address) (*state.Account, error) + func (s *Snapshot) GetCode(hash types.Hash) ([]byte, bool) + func (s *Snapshot) GetStorage(addr types.Address, root types.Hash, rawkey types.Hash) types.Hash + type State struct + func NewState(storage Storage) *State + func (s *State) AddState(root types.Hash, t *Trie) + func (s *State) GetCode(hash types.Hash) ([]byte, bool) + func (s *State) NewSnapshot() state.Snapshot + func (s *State) NewSnapshotAt(root types.Hash) (state.Snapshot, error) + func (s *State) SetCode(hash types.Hash, code []byte) + type Storage interface + Batch func() Batch + Close func() error + Get func(k []byte) ([]byte, bool) + GetCode func(hash types.Hash) ([]byte, bool) + Put func(k, v []byte) + SetCode func(hash types.Hash, code []byte) + func NewLevelDBStorage(path string, logger hclog.Logger) (Storage, error) + func NewMemoryStorage() Storage + type Trie struct + func NewTrie() *Trie + func NewTrieWithRoot(root Node) *Trie + func (t *Trie) Get(k []byte, storage Storage) ([]byte, bool) + func (t *Trie) Hash() types.Hash + func (t *Trie) Txn(storage Storage) *Txn + type Txn struct + func (t *Txn) Commit() *Trie + func (t *Txn) Delete(key []byte) + func (t *Txn) Hash() ([]byte, error) + func (t *Txn) Insert(key, value []byte) + func (t *Txn) Lookup(key []byte) []byte + type ValueNode struct + func (v *ValueNode) Hash() ([]byte, bool) + func (v *ValueNode) SetHash(b []byte) []byte