Skip to content

Commit

Permalink
fixs since last review
Browse files Browse the repository at this point in the history
  • Loading branch information
noel2004 committed Apr 24, 2023
1 parent 5438b11 commit cd5b554
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/state/state_prove.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package state

import (
"errors"
"fmt"

zkt "github.com/scroll-tech/zktrie/types"
Expand Down Expand Up @@ -54,7 +53,10 @@ func (s *StateDB) GetStorageTrieForProof(addr common.Address) (Trie, error) {
// try the trie in stateObject first, else we would create one
stateObject := s.getStateObject(addr)
if stateObject == nil {
return nil, errors.New("storage trie for requested address does not exist")
// still return a empty trie
addrHash := crypto.Keccak256Hash(addr[:])
dummy_trie, _ := s.db.OpenStorageTrie(addrHash, common.Hash{})
return dummy_trie, nil
}

trie := stateObject.trie
Expand Down

0 comments on commit cd5b554

Please sign in to comment.