From 298900cf96512f9b4c3893e607b338112d62f7d1 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 26 Jan 2024 16:55:40 +0100 Subject: [PATCH] core/state: Add StateDB.OpenStorageTrie --- core/state/statedb.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/state/statedb.go b/core/state/statedb.go index 905944cbb5..cd61b07297 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -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))