From 97bc95907db65e2b80cb3534f18efaac9b0ce985 Mon Sep 17 00:00:00 2001 From: Eddy Ashton Date: Mon, 22 Aug 2022 13:24:33 +0100 Subject: [PATCH] Correct printing of deleted entries when parsing snapshots (#4150) --- python/ccf/ledger.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/ccf/ledger.py b/python/ccf/ledger.py index 4d8a7be6b..539801777 100644 --- a/python/ccf/ledger.py +++ b/python/ccf/ledger.py @@ -236,7 +236,12 @@ class PublicDomain: def _read_snapshot_versioned_value(self): size = self._read_size() - _, value = self._read_versioned_value(size) + ver, value = self._read_versioned_value(size) + if ver < 0: + assert ( + len(value) == 0 + ), f"Expected empty value for tombstone deletion at {ver}" + value = None self._read_snapshot_entry_padding(size) return value