From cc658b5696c9d3b6049605657478f743d9a5fed7 Mon Sep 17 00:00:00 2001 From: Chiwon Cho Date: Tue, 10 Nov 2020 12:43:53 +0900 Subject: [PATCH] Fix stateRootHash mismatch at BH-17,264,910 * Fix a bug in IconScoreDatabase.delete() --- iconservice/iconscore/db.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iconservice/iconscore/db.py b/iconservice/iconscore/db.py index fedb758fa..30c1c52f9 100644 --- a/iconservice/iconscore/db.py +++ b/iconservice/iconscore/db.py @@ -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)