Skip to content

refactor(sdk-core): EdDSA MPCv2 DSG post-merge nits#8721

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

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

Conversation

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

Summary

  • Rename verifyBitGoMessageRoundOne/TwoverifyPeerMessageRoundOne/Two — both functions already accept any peer party, so the BitGo prefix is misleading. Updated all call sites and imports.
  • Unify parameter types — replace literal union params (0|1, 0|1|2) with MPCv2PartiesEnum in getSignatureShareRound{One,Two,Three} and partyIdToSignatureShareType. Add SignerPartyId = USER | BACKUP alias to enforce at the type level that the signer cannot be BITGO.
  • Remove dead runtime assert in partyIdToSignatureShareType — TypeScript now guarantees valid enum values at compile time; also removes the now-unused assert import.
  • Consistent error style — replace the lone if/throw GPG key guard in signRequestBase with assert(), matching all surrounding invariant checks.
  • New negative test — add should throw if round 2 response has wrong type to signTxRequest.ts, symmetric to the existing round-1 wrong-type test.

Test plan

  • modules/sdk-core EdDSA MPS DSG helper tests: 10 passing
  • modules/bitgo signTxRequest tests: 10 passing (includes new round-2 wrong-type test)
  • No TypeScript errors in changed files

Related

Closes WCI-372

🤖 Generated with Ralph

@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 branch from 33eb8c1 to 728bad2 Compare May 8, 2026 14:01
- 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
@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the WCI-372/eddsa-mpcv2-dsg-post-merge-nits branch from 728bad2 to 3c2ff18 Compare May 8, 2026 14:28
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.

1 participant