Skip to content

Commit

Permalink
fix ZkTrie's GetStorage (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop authored Jun 5, 2024
1 parent b0b4608 commit 20a7093
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions trie/zk_trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/ethereum/go-ethereum/crypto/poseidon"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie/trienode"
)

Expand Down Expand Up @@ -83,12 +82,7 @@ func (t *ZkTrie) GetAccount(address common.Address) (*types.StateAccount, error)

func (t *ZkTrie) GetStorage(_ common.Address, key []byte) ([]byte, error) {
sanityCheckByte32Key(key)
enc, err := t.TryGet(key)
if err != nil || len(enc) == 0 {
return nil, err
}
_, content, _, err := rlp.Split(enc)
return content, err
return t.TryGet(key)
}

func (t *ZkTrie) UpdateAccount(address common.Address, acc *types.StateAccount) error {
Expand Down

0 comments on commit 20a7093

Please sign in to comment.