Skip to content

Commit

Permalink
fix account encoding in cmd snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mortal123 committed May 24, 2023
1 parent ec5c3a9 commit 339e03f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/geth/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/crypto/codehash"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/rlp"
"github.com/scroll-tech/go-ethereum/zktrie"
)

Expand Down Expand Up @@ -405,8 +404,8 @@ func traverseRawState(ctx *cli.Context) error {
// dig into the storage trie further.
if accIter.Leaf() {
accounts += 1
var acc types.StateAccount
if err := rlp.DecodeBytes(accIter.LeafBlob(), &acc); err != nil {
var acc *types.StateAccount
if acc, err = types.UnmarshalStateAccount(accIter.LeafBlob()); err != nil {
log.Error("Invalid account encountered during traversal", "err", err)
return errors.New("invalid account")
}
Expand Down

0 comments on commit 339e03f

Please sign in to comment.