refactor(abstract-utxo): narrow descriptor PSBT type unions to wasm-only#8860
Merged
Conversation
assertValidTransaction / toBaseParsedTransactionOutputsFromPsbt only get called with wasm Psbt or Buffer; the UtxoLibPsbt branch was unused. Replace toWasmPsbt(...) with Psbt.deserialize(...) inline. Refs: T1-3279
davidkaplanbitgo
approved these changes
May 26, 2026
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.
Summary
Narrows three function signatures in `transaction/descriptor/{parse,verifyTransaction}.ts` and `offlineVault/descriptor/transaction.ts` from `Psbt | UtxoLibPsbt | Uint8Array` to `Psbt | Uint8Array`. All call sites pass either a wasm `Psbt` or a buffer — never a utxolib PSBT (verified by grep). The bridge call `toWasmPsbt(psbt)` becomes an inline `psbt instanceof Psbt ? psbt : Psbt.deserialize(psbt)`.
Also inlines the trivial `sumValues` helper locally in `parse.ts` so it no longer pulls from `wasmUtil.ts`.
PR group context
Part of an 8-PR fan-out removing `@bitgo/utxo-lib` from abstract-utxo runtime. Independent — file-disjoint from the other PRs in this group. Can merge in any order.
Test plan
🤖 Generated with Claude Code