Skip to content

Commit

Permalink
Add a proxy to Boatswain and a Boatswain to Counselor. This allows fo…
Browse files Browse the repository at this point in the history
…r communication of events from a delegated multisig AID in KERIA. (#542)
  • Loading branch information
pfeairheller committed Jul 17, 2023
1 parent 2e29677 commit 4185296
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 4185296

Please sign in to comment.