Skip to content

Commit

Permalink
core/state: Add StateDB.OpenStorageTrie
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed Jan 26, 2024
1 parent fb90ca3 commit 298900c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,12 @@ func (s *StateDB) convertAccountSet(set map[common.Address]*types.StateAccount)
return ret
}

// OpenStorageTrie opens the storage trie for the storage root of the provided address.
func (s *StateDB) OpenStorageTrie(addr common.Address) (Trie, error) {
storageRoot := s.GetStorageRoot(addr)
return s.db.OpenStorageTrie(s.originalRoot, addr, storageRoot, s.trie)
}

// copySet returns a deep-copied set.
func copySet[k comparable](set map[k][]byte) map[k][]byte {
copied := make(map[k][]byte, len(set))
Expand Down

0 comments on commit 298900c

Please sign in to comment.