Skip to content

[BWS, BWC] TSS - add copayerReady event#4132

Open
gabrielbazan7 wants to merge 1 commit intobitpay:masterfrom
gabrielbazan7:feat/tss-copayer-ready
Open

[BWS, BWC] TSS - add copayerReady event#4132
gabrielbazan7 wants to merge 1 commit intobitpay:masterfrom
gabrielbazan7:feat/tss-copayer-ready

Conversation

@gabrielbazan7
Copy link
Copy Markdown
Contributor

Description

Adds a copayerReady event to TssSign (BWC) so callers can track which copayers have joined a signing session in real time.

Changelog

  • BWC — TssSign now emits a copayerReady event with the copayer's ID when a participant joins a signing session. Self is emitted immediately on start(); remote participants are emitted during subscribe() once round 0 is complete.
  • BWS — GET /v1/tss/sign/:id/:round now includes a participants field (array of copayer IDs) in its response when a round is complete.
  • Tests

Testing Notes

Add any helpful notes for reviewers to test your code here.


Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

const p = session.participants.find(p => p.partyId === m.fromPartyId);
return p?.copayerId;
}).filter(Boolean) as string[];
return { messages, signature: session.signature, participants };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you wanting the participants to be returned to the client in real time? Currently, this logic is only hit once all participants have joined (per line 300: if (otherPartyMsgs.length === session.m - 1)). If you want it to be real time, we should move this new logic to be between lines 299-300 and then return participants in the returned object on line 311 (after the if block) as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change it as noted above, then the client will just need to be aware that the copayerReady event will fire duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants