Skip to content

Commit a50928a

Browse files
fix(trie): minor fix for the trie panic (#3344)
minor fix for the trie panic
1 parent c573f1b commit a50928a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

core/trie/trie.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,13 @@ func (t *Trie) Hash() (felt.Felt, error) {
791791
}
792792

793793
storage := t.storage
794-
t.storage = storage.SyncedStorage()
795-
defer func() { t.storage = storage }()
794+
syncedStorage := storage.SyncedStorage()
795+
t.storage = syncedStorage
796+
t.readStorage = syncedStorage.ReadStorage
797+
defer func() {
798+
t.storage = storage
799+
t.readStorage = storage.ReadStorage
800+
}()
796801
root, err := t.updateValueIfDirty(t.rootKey)
797802
if err != nil {
798803
return felt.Zero, err

0 commit comments

Comments
 (0)