Features/txbuilder expose params#839
Closed
xsats wants to merge 19 commits intobitcoindevkit:masterfrom
Closed
Conversation
24 tasks
Member
|
Concept ACK, this needs a rebase. |
We don't automatically want to make the interface `async` based on the used architecture, but now require the user to explicitly set the `async-interface` feature.
This enables e.g. `assert_eq!` comparisons of `SyncTime` in tests.
Small thing but I had to look up the code to see what the returned boolean was about, thought it might be good to have in the docs.
Member
|
Concept ACK I think this would be a useful method. The PR has picked up a bunch of other work however, and so it's very hard to review. I'm wondering if it could be cleaned up to help reviewers. |
Collaborator
|
Concept ACK but don't merge this before #793. We have an issue to re-do tx building eventually: LLFourn/bdk_core_staging#40 |
Member
|
@xsats after the alpha.1 release is tagged would be a good time to rebase this one so we can try to get it into the alpha.2 release. |
Member
|
Outdated. Also we have put a feature freeze on |
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.
Description
Currently,
tx_builderTxParams are not exposed publicly, although it has been noted in the code the intention for the struct to be exposed publicly. Exposing TxParams enables the current state of TxBuilder (i.e. loaded transaction parameters) to be accessed prior to callingtx_builder::finish()to construct a PSBT.This would be useful for a number of reasons, including enabling BDK users to view and validate the configuration of a TxBuilder instance at a specific point in the code without needing to finalise TxBuilder to obtain a PSBT (and subsequently initialise a brand new TxBuilder from scratch if e.g. something intended is missing) which is necessary at present since TxBuilder's contents are private.
This PR introduces a
tx_builder::get_params()method which can be called on a TxBuilder instance at any time to retrieve the current state of the TxBuilder/TxParams, and adds a basic correspondingget_params()test.Notes to the reviewers
The
tx_builder_testTxBuilder instance used in theget_params()test was kept barebones, with only two tx config options added via their respective methods, in an attempt to keep the test data size to a minimum and avoid clutter.If it's deemed beneficial for a more complex/realistic TxBuilder instance to be used in the
get_params()test, I can add additional TxBuilder methods (e.g. recipients, fee rate) and amend the expected test data respectively.Changelog notice
wallet::tx_builder::get_paramsmethodChecklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: