Skip to content

refactor(abstract-utxo): delete unreachable utxolib explainPsbt path#8857

Draft
OttoAllmendinger wants to merge 4 commits into
masterfrom
otto/abstract-utxo-foundation
Draft

refactor(abstract-utxo): delete unreachable utxolib explainPsbt path#8857
OttoAllmendinger wants to merge 4 commits into
masterfrom
otto/abstract-utxo-foundation

Conversation

@OttoAllmendinger
Copy link
Copy Markdown
Contributor

@OttoAllmendinger OttoAllmendinger commented May 26, 2026

Summary

Removes dead and unreachable code in modules/abstract-utxo/src/ as a first step toward dropping @bitgo/utxo-lib from the runtime. All changes are pure deletions or trivial mechanical replacements with no behaviour change.

Changes, in order:

  1. remove supportedTxFormats and supportedSdkBackends — dead format-gating code, never had effect
  2. remove unreachable utxolib and legacy tx code paths — deletes signLegacyTransaction.ts, signPsbtUtxolib.ts; removes branches already gated unreachable
  3. replace utxolib.bitgo.isPsbt with hasPsbtMagic — direct one-liner replacement, no logic change
  4. delete unreachable utxolib explainPsbt path — removes explainPsbt.ts and associated branch in parsePsbt

PR group context

Stack: master → this PR → drop-fetchinputs → abstract-utxo-replacements → keychains-drop-utxolib → abstract-utxo-terminal

Test plan

  • yarn tsc --noEmit clean in modules/abstract-utxo
  • yarn lint clean in modules/abstract-utxo
  • All abstract-utxo unit tests pass

🤖 Generated with Claude Code

@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner May 26, 2026 09:12
@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-foundation branch 2 times, most recently from 2c47e44 to b70ae1c Compare May 26, 2026 10:11
@OttoAllmendinger OttoAllmendinger requested review from a team as code owners May 26, 2026 10:11
@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-foundation branch from b70ae1c to 2e0c4af Compare May 26, 2026 11:01
OttoAllmendinger and others added 4 commits June 1, 2026 17:55
…ckends

Both properties were hardcoded constants (legacy: false, utxolib: false).
Inline the values at the call site: drop the dead psbt-format guard,
make the legacy-format path an unconditional throw, and replace the
backend availability check with a direct utxolib comparison.

Refs: T1-3245, T1-3280
Co-authored-by: llm-git <llm-git@ttll.de>
…e paths

Delete signLegacyTransaction.ts and signPsbtUtxolib.ts entirely. Collapse
decodePsbtWith (utxolib/wasm-utxo overloads) into a single decodePsbt.
Remove UtxoTransaction/UtxoPsbt from DecodedTransaction, SdkBackend type
and isSdkBackend guard, explainLegacyTx and its helpers, UtxoPsbt signing
branches from signTransaction, and all decodeWith interface fields.

Also fixes decodeTransaction to convert string input to buffer before the
isPsbt check, so non-PSBT hex correctly throws ErrorDeprecatedTxFormat
rather than a generic wasm deserialization error.

Refs: T1-3245, T1-3280
Co-authored-by: llm-git <llm-git@ttll.de>
Use wasm-utxo's hasPsbtMagic and the local toTNumber helper in place of
utxolib.bitgo.isPsbt and utxolib.bitgo.toTNumber in abstractUtxoCoin.ts
and the fixed-script verifyTransaction path.

Refs: T1-3279
The utxolib variant of explainPsbt is no longer called from any src file
(transaction/explainTransaction.ts dispatches only to explainPsbtWasm).
Delete it along with helpers that became dead, and migrate the few test
callers to explainPsbtWasm.

Refs: T1-3279
@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-foundation branch 3 times, most recently from 4b8b110 to c011adb Compare June 2, 2026 08:23
@OttoAllmendinger OttoAllmendinger changed the title refactor(abstract-utxo): remove utxolib from runtime hot path refactor(abstract-utxo): remove dead code and unreachable utxolib paths Jun 2, 2026
@OttoAllmendinger OttoAllmendinger force-pushed the otto/abstract-utxo-foundation branch from c011adb to f3ecc52 Compare June 2, 2026 08:51
@OttoAllmendinger OttoAllmendinger changed the title refactor(abstract-utxo): remove dead code and unreachable utxolib paths refactor(abstract-utxo): delete unreachable utxolib explainPsbt path Jun 2, 2026
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