Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes KeyStates.query with seal parameter #172

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,9 @@ def recur(self, tyme, deeds=None):
seqNoDo = querying.SeqNoQuerier(hby=self.hby, hab=self.agentHab, pre=pre, sn=sn)
self.extend([seqNoDo])
elif "anchor" in msg:
pass
anchor = msg['anchor']
anchorDo = querying.AnchorQuerier(hby=self.hby, hab=self.agentHab, pre=pre, anchor=anchor)
self.extend([anchorDo])
else:
qryDo = querying.QueryDoer(hby=self.hby, hab=self.agentHab, pre=pre, kvy=self.kvy)
self.extend([qryDo])
Expand Down
2 changes: 1 addition & 1 deletion src/keria/core/longrunning.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def status(self, op):
operation.done = False
elif "anchor" in op.metadata:
anchor = op.metadata["anchor"]
if self.hby.db.findAnchoringEvent(op.oid, anchor=anchor) is not None:
if self.hby.db.findAnchoringSealEvent(op.oid, seal=anchor) is not None:
operation.done = True
operation.response = asdict(kever.state())
else:
Expand Down
7 changes: 6 additions & 1 deletion tests/app/test_agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,12 @@ def test_querier(helpers):
# Anchor not implemented yet
qry.queries.append(dict(pre="EI7AkI40M11MS7lkTCb10JC9-nDt-tXwQh44OHAFlv_9", anchor={}))
qry.recur(1.0, deeds=deeds)
assert len(qry.doers) == 0
assert len(qry.doers) == 1
anchorDoer = qry.doers[0]
assert isinstance(anchorDoer, querying.AnchorQuerier) is True
assert anchorDoer.pre == "EI7AkI40M11MS7lkTCb10JC9-nDt-tXwQh44OHAFlv_9"
assert anchorDoer.anchor == {}
qry.doers.remove(anchorDoer)

qry.queries.append(dict(pre="EI7AkI40M11MS7lkTCb10JC9-nDt-tXwQh44OHAFlv_9"))
qry.recur(1.0, deeds=deeds)
Expand Down
Loading