Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/state, trie, light: Add a DeleteAccount method #25531

Merged
merged 4 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review feedback
  • Loading branch information
gballet committed Aug 16, 2022
commit ba590386e53cfdd2beef9accb5f3e1b9e7358e4c
1 change: 1 addition & 0 deletions light/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (t *odrTrie) TryDelete(key []byte) error {
})
}

// DeleteACcount abstracts an account deletion from the trie.
func (t *odrTrie) DeleteAccount(key []byte) error {
key = crypto.Keccak256(key)
return t.do(key, func() error {
Expand Down
1 change: 1 addition & 0 deletions trie/secure_trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func (t *StateTrie) TryDelete(key []byte) error {
return t.trie.TryDelete(hk)
}

// DeleteACcount abstracts an account deletion from the trie.
func (t *StateTrie) DeleteAccount(key []byte) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+docstring

hk := t.hashKey(key)
delete(t.getSecKeyCache(), string(hk))
Expand Down