Skip to content

Commit

Permalink
reverse the delte account fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Feb 29, 2024
1 parent 04e7aa0 commit a53226d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions trie/verkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,25 @@ func (trie *VerkleTrie) UpdateStorage(address common.Address, key, value []byte)
}

func (t *VerkleTrie) DeleteAccount(addr common.Address) error {
var (
err error
values = make([][]byte, verkle.NodeWidth)
stem = t.pointCache.GetTreeKeyVersionCached(addr[:])
)

for i := 0; i < verkle.NodeWidth; i++ {
values[i] = zero[:]
}
switch root := t.root.(type) {
case *verkle.InternalNode:
err = root.InsertValuesAtStem(stem, values, t.FlatdbNodeResolver)
default:
return errInvalidRootType
}
if err != nil {
return fmt.Errorf("DeleteAccount (%x) error: %v", addr, err)
}

return nil
}

Expand Down

0 comments on commit a53226d

Please sign in to comment.