Skip to content

fix(sdk-coin-ton): return MPCSweepTxs from recover() for unsigned sweeps - #9864

Open
vibhavgo wants to merge 1 commit into
masterfrom
WCI-680-ton-unsigned-sweep-mpc-format
Open

vibhavgo wants to merge 1 commit into
masterfrom
WCI-680-ton-unsigned-sweep-mpc-format

Conversation

@vibhavgo

Copy link
Copy Markdown
Contributor

Summary

`recover()` was returning a bare `MPCTx` for unsigned sweeps instead of the `MPCSweepTxs` format that OVC's TSS form requires. The TSS form reads `txRequest.walletCoin` to determine the MPC algorithm — the bare return caused silent upload failure at the start of the 5-pass OVC ceremony.

Other coins already follow this convention — see `sdk-coin-polyx` `polyx.ts:263` which returns `{ txRequests: [txRequest] }`. This PR aligns TON with that established pattern.

Linear: WCI-680

Changes

  • `modules/sdk-coin-ton/src/ton.ts`: wrap `isUnsignedSweep` return value in `MPCSweepTxs` shape
  • `modules/sdk-coin-ton/test/unit/ton.ts`: add real (non-stub) test calling `recover()` with mocked network that asserts the full `MPCSweepTxs` structure — mirrors the test pattern in `sdk-coin-polyx`

Test Plan

  • `BITGOJS_TEST_PASSWORD=test npx mocha --grep "should generate unsigned sweep in MPCSweepTxs"` — 1 passing
  • Full `yarn unit-test` in `modules/sdk-coin-ton` passes
  • End-to-end: fresh TTON unsigned sweep from WRW uploads successfully to OVC 5-pass ceremony and broadcasts successfully on testnet

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

WCI-680

@vibhavgo vibhavgo closed this Sep 30, 2026
@vibhavgo vibhavgo reopened this Sep 30, 2026
@vibhavgo
vibhavgo force-pushed the WCI-680-ton-unsigned-sweep-mpc-format branch from aacfda5 to 60c197b Compare September 30, 2026 09:49
@vibhavgo

Copy link
Copy Markdown
Contributor Author

Reference: Other coins returning MPCSweepTxs from recover()

TON's recover() was the only MPCv2 EdDSA coin that returned a bare MPCTx instead of wrapping it in the MPCSweepTxs envelope. The following coins follow the correct pattern this PR aligns TON with:

OVC's sign-tss-first-trip-form requires txRequest.walletCoin on the parsed result — the { txRequests: [{ walletCoin, transactions: [...] }] } shape is what parseJsonTransactions routes to the TSS path. Without this wrapping, upload silently fails in the OVC UI.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@vibhavgo
vibhavgo force-pushed the WCI-680-ton-unsigned-sweep-mpc-format branch from 60c197b to 888e195 Compare September 30, 2026 09:58
@vibhavgo
vibhavgo marked this pull request as ready for review September 30, 2026 09:59
@vibhavgo
vibhavgo requested a review from a team as a code owner September 30, 2026 09:59
@vibhavgo
vibhavgo requested a review from mukeshsp September 30, 2026 09:59
recover() was returning a bare MPCTx for unsigned sweeps instead of the
MPCSweepTxs format that OVC requires. Other coins already follow this convention.
Also update the MPCv2 sweep test to unwrap the new envelope shape.

Ticket: WCI-680
@vibhavgo
vibhavgo force-pushed the WCI-680-ton-unsigned-sweep-mpc-format branch from 888e195 to 6ae3e01 Compare September 30, 2026 10:08

This branch has not been deployed

No deployments
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