Skip to content

Commit

Permalink
fix: add qnfs database to clear escrow
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull committed Oct 1, 2024
1 parent 70fa63b commit 30e7a53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/keri/db/basing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions tests/db/test_basing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 30e7a53

Please sign in to comment.