Skip to content

fix(sdk-coin-polyx): stub getMaterial in recovery unit tests#9108

Merged
yashvanthbl137-crypto merged 1 commit into
masterfrom
fix/polyx-recovery-metadata
Jun 24, 2026
Merged

fix(sdk-coin-polyx): stub getMaterial in recovery unit tests#9108
yashvanthbl137-crypto merged 1 commit into
masterfrom
fix/polyx-recovery-metadata

Conversation

@yashvanthbl137-crypto

@yashvanthbl137-crypto yashvanthbl137-crypto commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stub getMaterial in POLYX recovery unit tests so transaction build and decode use the same bundled metadata
  • Fixes CI failures in @bitgo/sdk-coin-polyx after Polymesh testnet upgraded to runtime v8 (specVersion: 8000000)
  • Matches the existing pattern in @bitgo/sdk-coin-dot recovery tests

Problem

Recover Transactions unit tests were failing:

  • should recover a tx for non-bitgo recoveries
  • should recover a txn for unsigned-sweep recoveries
    recover() called live getMaterial() (v8 metadata from wss://testnet-rpc.polymesh.live) while getBuilder().from(serializedTx) decoded using bundled v7 metadata (specVersion: 7002000). The mismatch caused decode errors (e.g. treasury.disbursement, system.killStorage).

Fix

Test-only change in modules/sdk-coin-polyx/test/unit/polyx.ts:

getMaterialCB = sandBox.stub(Polyx.prototype, 'getMaterial' as keyof Polyx);
getMaterialCB.resolves(utils.getMaterial(coins.get('tpolyx').network.type));
Production recover() is unchanged and still fetches live metadata for real broadcasts.

Ticket : CGD-1862

@yashvanthbl137-crypto yashvanthbl137-crypto marked this pull request as ready for review June 24, 2026 14:50
@yashvanthbl137-crypto yashvanthbl137-crypto requested a review from a team as a code owner June 24, 2026 14:50
@yashvanthbl137-crypto yashvanthbl137-crypto merged commit 0f70258 into master Jun 24, 2026
24 checks passed
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