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

Commit

Permalink
Fix stateRootHash mismatch at BH-17,264,910
Browse files Browse the repository at this point in the history
* Fix a bug in IconScoreDatabase.delete()
  • Loading branch information
goldworm committed Nov 10, 2020
1 parent 2c96033 commit cc658b5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iconservice/iconscore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,9 @@ def delete(self, key: Union[bytes, Key]):
final_key: bytes = new_kv_pair.key if new_kv_pair.key else old_kv_pair.key
value: bytes = new_kv_pair.value if new_kv_pair.value else old_kv_pair.value

if value is None:
return

if self._observer:
self._observer.on_delete(self._context, self._to_key_body(final_key), value)
if value:
self._observer.on_delete(self._context, self._to_key_body(final_key), value)

self._context_db_delete(old_kv_pair.key)
self._context_db_delete(new_kv_pair.key)
Expand Down

0 comments on commit cc658b5

Please sign in to comment.