bitcoindevkit / bitcoindevkit/bdk-tx
Remove `CreatePsbtError::UnsupportedVersion` variant
- Dominant language
- Rust
- Stars
- 13
- Forks
- 17
- Avg merge
- 17h 22m
- Merged PRs (30d)
- 1
Description
### Description
It is true that certain tx features require a minimum transaction version. Instead of erroring, we should just bump the transaction version.
This removes an error variant. It is the caller's responsibility to not pick inputs that require spending paths which require transaction versions that they do not wish to create.
### Proposed Changes
* Rename `PsbtParams::version` to `PsbtParams::min_version`.
* Tx version is bumped to `Version::TWO` if any input requires CSV. AFS also bumps the tx version if the sequence branch is picked.
* Update docs.
* Remove the `UnsupportedVersion` error in `CreatePsbtError`.
Contributor guide
Research direction
Start by locating PsbtParams, CreatePsbtError, and the transaction-version selection logic, then read the tests covering CSV and AFS inputs. Trace how PsbtParams::version and UnsupportedVersion are used before updating the API and documentation. Done means min_version is used, required inputs or sequence branches bump to Version::TWO, and the obsolete error variant and expectations are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100