feat: add WASM-based DOT transaction parsing via @bitgo/wasm-dot#8074
Open
feat: add WASM-based DOT transaction parsing via @bitgo/wasm-dot#8074
Conversation
8f026fb to
93666ed
Compare
25ff6c2 to
9573f45
Compare
158a9ee to
5a95281
Compare
a6c6162 to
37c8882
Compare
5d82741 to
25b65b8
Compare
Integrates @bitgo/wasm-dot into sdk-coin-dot for WASM-based transaction parsing using Rust/subxt, replacing the JS txwrapper-polkadot path for tdot (testnet) signed transactions. ## what changed - **wasmParser.ts**: new module with `explainDotTransaction()` and `toJsonFromWasm()` that parse DOT extrinsics via WASM and map to BitGoJS TransactionExplanation / TxData formats. handles transfers, staking (bond, unbond, withdraw, chill, payout), proxy (add/remove), batch (nested + atomic), and transferAll. - **transaction.ts toJson()**: signed tdot transactions now use the WASM path (`toJsonFromWasm`), which handles metadata-aware signed extension parsing (e.g. Westend's AuthorizeCall, StorageWeightReclaim). unsigned transactions still use the legacy txwrapper path. - **webpack config**: added ESM alias for @bitgo/wasm-dot so browser builds use the fetch-based WASM loader instead of fs.readFileSync. - **tests**: 72+ new test lines in dot.ts covering WASM explain for transfers and staking. 511-line byte comparison test suite validating WASM builder output matches legacy txwrapper output byte-for-byte across all transaction types (transfer, stake, unstake, withdraw, chill, proxy, batch). - **withdrawUnstakedBuilder test fix**: numSlashingSpans assertion updated from string to number to match actual type. ## scope WASM path is only active for tdot signed transactions, gated by `this._coinConfig.name === 'tdot' && this._signedTransaction`. mainnet dot remains on the legacy path until validation is complete. BTC-0 TICKET: BTC-0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates @bitgo/wasm-dot into sdk-coin-dot for WASM-based transaction
parsing using Rust/subxt, replacing the JS txwrapper-polkadot path for
tdot (testnet) signed transactions.
what changed
wasmParser.ts: new module with
explainDotTransaction()andtoJsonFromWasm()that parse DOT extrinsics via WASM and map toBitGoJS TransactionExplanation / TxData formats. handles transfers,
staking (bond, unbond, withdraw, chill, payout), proxy (add/remove),
batch (nested + atomic), and transferAll.
transaction.ts toJson(): signed tdot transactions now use the WASM
path (
toJsonFromWasm), which handles metadata-aware signed extensionparsing (e.g. Westend's AuthorizeCall, StorageWeightReclaim). unsigned
transactions still use the legacy txwrapper path.
webpack config: added ESM alias for @bitgo/wasm-dot so browser
builds use the fetch-based WASM loader instead of fs.readFileSync.
tests: 72+ new test lines in dot.ts covering WASM explain for
transfers and staking. 511-line byte comparison test suite validating
WASM builder output matches legacy txwrapper output byte-for-byte
across all transaction types (transfer, stake, unstake, withdraw,
chill, proxy, batch).
withdrawUnstakedBuilder test fix: numSlashingSpans assertion
updated from string to number to match actual type.
scope
WASM path is only active for tdot signed transactions, gated by
this._coinConfig.name === 'tdot' && this._signedTransaction. mainnetdot remains on the legacy path until validation is complete.
TICKET: BTC-3068