Skip to content

fix(sdk-core): allow disabletoken in sendTokenEnablement guard - #9854

Merged
hrishikeshjain merged 1 commit into
masterfrom
chalo-1621-canton-disabletoken-support
Sep 29, 2026
Merged

hrishikeshjain merged 1 commit into
masterfrom
chalo-1621-canton-disabletoken-support

Conversation

@hrishikeshjain

Copy link
Copy Markdown
Contributor

Summary

sendTokenEnablement's validation guard rejected buildParams.type === 'disabletoken', so disabling a Canton 1-step TransferPreapproval threw Invalid build of token enablement. immediately after a successful prebuild.

Changes

  • prebuildTransactionTxRequests already handles 'disabletoken' (added in f9ce83d, wiring the disableToken intent for Canton), but the companion allow-list in sendTokenEnablement (used by sendTokenEnablements) still only accepted 'enabletoken' / 'enableMpt'. Added 'disabletoken' to that allow-list, mirroring 'enabletoken'.
  • Added a unit test asserting buildParams.type === 'disabletoken' passes validation and proceeds to initiateTransaction, matching the existing enabletoken/enableMpt coverage.

Test Plan

Automated:

  • Unit tests added/updated (modules/sdk-core/test/unit/bitgo/wallet/tokenApproval.ts)
  • npx mocha test/unit/bitgo/wallet/**/*.ts — 221 passing
  • npx tsc --noEmit — clean
  • npx eslint — 0 errors

Ticket (REQUIRED)

CHALO-1495


PR Checklist

Code Quality

  • No commented-out code
  • No console.log statements

Testing

  • Tests pass locally
  • New code has test coverage

Hygiene

  • Branch follows [TICKET]-description pattern
  • PR < 500 lines (target: < 200)
  • Ticket linked above

prebuildTransactionTxRequests gained a 'disabletoken' case in
f9ce83d (wire disabletoken prebuild intent for Canton), so
prebuildTransaction succeeds for Canton disable-token flows. But
sendTokenEnablement's validation guard still only allow-listed
buildParams.type 'enabletoken'/'enableMpt', so sendTokenEnablements
(and the retail-web disable-token UI, which calls it) threw
'Invalid build of token enablement.' immediately after a successful
prebuild.

Adds 'disabletoken' to the allow-list, mirroring 'enabletoken'.

Ticket: CHALO-1495
@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

CHALO-1621

@github-actions

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

@hrishikeshjain
hrishikeshjain merged commit 0db58b6 into master Sep 29, 2026
26 of 27 checks passed

This branch had an error being deployed

1 failed deployment
beta-alpha-release — d3419527 Deployed Sep 29, 2026 by hrishikeshjain via Publish Release #3088
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