Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
fix contract destroy storage deletion (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Jul 29, 2019
1 parent d49a1ad commit 9e8421a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ All notable changes to this project are documented in this file.
- Fix ``NOT`` VM instruction
- Fix StackItem deserialization for ``Boolean`` VM type
- Update ``CheckDynamicInvoke`` to operate on snapshots
- Fix ``Contract.Destroy`` not always deleting storage


[0.8.4] 2019-02-14
Expand Down
2 changes: 1 addition & 1 deletion neo/SmartContract/StateReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def Contract_Destroy(self, engine):

to_del = []
for k, v in self.Snapshot.Storages.Find(hash.ToArray()):
storage_key = StorageKey(script_hash=hash, key=k)
storage_key = StorageKey(script_hash=hash, key=k[20:])
# Snapshot.Storages.Delete() modifies the underlying dictionary of the cache we'd be iterating
# over using Storages.Find. We therefore need to postpone deletion
to_del.append(storage_key)
Expand Down

0 comments on commit 9e8421a

Please sign in to comment.