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

Add a proxy to Boatswain and a Boatswain to Counselor. #542

Merged
merged 1 commit into from
Jul 17, 2023
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
5 changes: 4 additions & 1 deletion src/keri/app/delegating.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Boatswain(doing.DoDoer):

"""

def __init__(self, hby, **kwa):
def __init__(self, hby, proxy=None, **kwa):
"""
For the current event, gather the current set of witnesses, send the event,
gather all receipts and send them to all other witnesses
Expand All @@ -45,6 +45,7 @@ def __init__(self, hby, **kwa):
self.postman = forwarding.Poster(hby=hby)
self.witq = agenting.WitnessInquisitor(hby=hby)
self.witDoer = agenting.Receiptor(hby=self.hby)
self.proxy = proxy

super(Boatswain, self).__init__(doers=[self.witq, self.witDoer, self.postman, doing.doify(self.escrowDo)],
**kwa)
Expand Down Expand Up @@ -75,6 +76,8 @@ def delegation(self, pre, sn=None, proxy=None):
phab = hab
elif proxy is not None:
phab = proxy
elif self.proxy is not None:
phab = self.proxy
else:
raise kering.ValidationError("no proxy to send messages for delegation")

Expand Down
4 changes: 2 additions & 2 deletions src/keri/app/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

class Counselor(doing.DoDoer):

def __init__(self, hby, **kwa):
def __init__(self, hby, swain=None, **kwa):

self.hby = hby
self.swain = delegating.Boatswain(hby=self.hby)
self.swain = swain if swain is not None else delegating.Boatswain(hby=self.hby)
self.witDoer = agenting.Receiptor(hby=self.hby)
self.witq = agenting.WitnessInquisitor(hby=hby)

Expand Down