Skip to content

refactor(abstract-utxo): narrow descriptor PSBT type unions to wasm-only#8860

Merged
OttoAllmendinger merged 1 commit into
masterfrom
otto/descriptor-psbt-narrowing
May 26, 2026
Merged

refactor(abstract-utxo): narrow descriptor PSBT type unions to wasm-only#8860
OttoAllmendinger merged 1 commit into
masterfrom
otto/descriptor-psbt-narrowing

Conversation

@OttoAllmendinger
Copy link
Copy Markdown
Contributor

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

  • `yarn tsc --noEmit` clean in `modules/abstract-utxo`
  • `yarn lint` clean in `modules/abstract-utxo`

🤖 Generated with Claude Code

assertValidTransaction / toBaseParsedTransactionOutputsFromPsbt only get
called with wasm Psbt or Buffer; the UtxoLibPsbt branch was unused.
Replace toWasmPsbt(...) with Psbt.deserialize(...) inline.

Refs: T1-3279
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner May 26, 2026 09:13
@OttoAllmendinger OttoAllmendinger merged commit 88b995d into master May 26, 2026
22 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