From 30e7a53794eefbfaf512c4f008d86461986dd64b Mon Sep 17 00:00:00 2001 From: Kent Bull Date: Tue, 1 Oct 2024 13:05:41 -0600 Subject: [PATCH] fix: add qnfs database to clear escrow --- src/keri/db/basing.py | 5 ++++- tests/db/test_basing.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/keri/db/basing.py b/src/keri/db/basing.py index ea799838..32077072 100644 --- a/src/keri/db/basing.py +++ b/src/keri/db/basing.py @@ -1385,8 +1385,11 @@ def clearEscrows(self): self.delOoes(key=k) for (k, _) in self.getLdeItemIter(): self.delLdes(key=k) + for (pre, said), edig in self.qnfs.getItemIter(): + self.qnfs.rem(keys=(pre, said)) - for escrow in [self.misfits, self.delegables, self.pdes, self.udes, self.rpes, self.epsd, self.eoobi, + + for escrow in [self.qnfs, self.misfits, self.delegables, self.pdes, self.udes, self.rpes, self.epsd, self.eoobi, self.dpub, self.gpwe, self.gdee, self.dpwe, self.gpse, self.epse, self.dune]: escrow.trim() diff --git a/tests/db/test_basing.py b/tests/db/test_basing.py index 7ab9a541..ad4a17ee 100644 --- a/tests/db/test_basing.py +++ b/tests/db/test_basing.py @@ -1832,6 +1832,9 @@ def test_clear_escrows(): pre = b'k' snh = b'snh' saidb = b'saidb' + db.qnfs.add(keys=(pre, saidb), val=b"z") + assert db.qnfs.cnt(keys=(pre, saidb)) == 1 + db.misfits.add(keys=(pre, snh), val=saidb) assert db.misfits.cnt(keys=(pre, snh)) == 1 @@ -1888,6 +1891,7 @@ def test_clear_escrows(): assert db.getUwes(key) == [] assert db.getOoes(key) == [] assert db.getLdes(key) == [] + assert db.qnfs.cnt(keys=(pre, saidb)) == 0 assert db.misfits.cnt(keys=(pre, snh)) == 0 assert db.delegables.cnt(keys=snKey(pre, 0)) == 0 assert db.pdes.cnt(keys=snKey(pre, 0)) == 0