feat(abstract-utxo): improve transaction parsing and handling#7558
Merged
OttoAllmendinger merged 9 commits intomasterfrom Nov 19, 2025
Merged
feat(abstract-utxo): improve transaction parsing and handling#7558OttoAllmendinger merged 9 commits intomasterfrom
OttoAllmendinger merged 9 commits intomasterfrom
Conversation
…tests Refactored the conditional structure in parsePsbt test file to improve readability by using an early return pattern instead of a nested if block. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
This way the transaction is standard per policy rules, which some of our tests expect. It maybe worthwhile to have a non-standard consensus-valid suite and maybe even an consensus-invalid suite, but that is for another time. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Handles script recipients properly by not attempting to canonicalize them. Also makes address required to ensure proper type safety and consistent behavior. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Improve error message for non-encodeable scriptPubkeys by displaying the amount and address directly instead of stringifying the entire output object, which can cause issues with bigint values. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Add test coverage for parsing RBF transactions in PSBT format by: - Adding logic to handle rbfTxIds in test parameters - Mocking wallet.getTransaction for RBF test cases - Adding a dedicated RBF test case with txid placeholder Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Added ability to set a recipient address as a change address for testing and verification purposes. This helps with scenarios where we need to test custom change addresses without applying size constraints. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Extracted RBF parsing and output conversion logic into separate functions for better code organization and readability. This improves maintainability and makes the transaction parsing flow clearer. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Move transaction explanation logic after expected outputs calculation to improve logical flow. Change how external change addresses are handled in expectedOutputs to use 'max' amount instead of adding all outputs. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
Adds new test cases that use WASM implementation for parsing PSBTs in fixedScript/parsePsbt.ts. The code extracts a utility function into a shared util.ts file and reuses it across test files. Issue: BTC-2732 Co-authored-by: llm-git <llm-git@ttll.de>
davidkaplanbitgo
approved these changes
Nov 19, 2025
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.
This PR enhances the transaction parsing and output handling in the
abstract-utxo package with several key improvements:
readability, including extraction of RBF parsing and output conversion
into separate functions
useful information
BTC-2732