Skip to content

refactor(sdk-core): eddsa MPCv2 DSG post-merge nits#8724

Open
bitgo-ai-agent-dev[bot] wants to merge 1 commit intomasterfrom
WCI-372/eddsa-mpcv2-dsg-post-merge-nits-v2
Open

refactor(sdk-core): eddsa MPCv2 DSG post-merge nits#8724
bitgo-ai-agent-dev[bot] wants to merge 1 commit intomasterfrom
WCI-372/eddsa-mpcv2-dsg-post-merge-nits-v2

Conversation

@bitgo-ai-agent-dev
Copy link
Copy Markdown

Summary

  • Rename verifyBitGoMessageRoundOne/TwoverifyPeerMessageRoundOne/Two to reflect that the functions accept any peer party, not just BitGo
  • Unify literal union param types (0|1, 0|1|2) to MPCv2PartiesEnum in getSignatureShareRound{One,Two,Three} and partyIdToSignatureShareType; add SignerPartyId alias enforcing USER|BACKUP for signer params
  • Remove dead runtime assert in partyIdToSignatureShareType (TypeScript now guarantees valid enum values at compile time) and unused assert import
  • Replace if/throw GPG key guard in signRequestBase with assert() for consistency with surrounding invariant checks
  • Add round-2 wrong-type negative test to signTxRequest test suite, symmetric to the existing round-1 wrong-type test

Test plan

  • Existing unit tests pass (yarn run unit-test --scope bitgo and yarn run unit-test --scope @bitgo/sdk-core)
  • New negative test (should throw if round 2 response has wrong type) exercises the round-2 wrong-type path
  • TypeScript compilation passes (no type errors from the enum unification)
  • Prettier formatting check passes (yarn check-fmt)

Ticket: WCI-372

- Rename verifyBitGoMessageRoundOne/Two -> verifyPeerMessageRoundOne/Two
  to reflect that the functions accept any peer party, not just BitGo
- Unify literal union param types (0|1, 0|1|2) to MPCv2PartiesEnum in
  getSignatureShareRound{One,Two,Three} and partyIdToSignatureShareType;
  add SignerPartyId alias enforcing USER|BACKUP for signer params
- Remove dead runtime assert in partyIdToSignatureShareType (TypeScript
  now guarantees valid enum values at compile time) and unused assert import
- Replace if/throw GPG key guard in signRequestBase with assert() for
  consistency with surrounding invariant checks
- Add round-2 wrong-type negative test to signTxRequest test suite,
  symmetric to existing round-1 wrong-type test

Ticket: WCI-372
Session-Id: f87490c7-3cae-4e41-8080-cf6fab5f55b4
Task-Id: cf4b9ca6-45e4-4f2a-99a6-898185b4f147
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 8, 2026

WCI-372

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the WCI-372/eddsa-mpcv2-dsg-post-merge-nits-v2 branch from f3de859 to c3dee70 Compare May 8, 2026 18:08
@Marzooqa Marzooqa marked this pull request as ready for review May 11, 2026 10:42
@Marzooqa Marzooqa requested review from a team as code owners May 11, 2026 10:42
Copy link
Copy Markdown
Contributor

@pranishnepal pranishnepal left a comment

Choose a reason for hiding this comment

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

Type-ify ENUM

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.

3 participants