Remove TransactionDetails from Wallet API#1048
Merged
evanlinjin merged 6 commits intobitcoindevkit:masterfrom Aug 31, 2023
Merged
Remove TransactionDetails from Wallet API#1048evanlinjin merged 6 commits intobitcoindevkit:masterfrom
evanlinjin merged 6 commits intobitcoindevkit:masterfrom
Conversation
c26c9c6 to
51fe7f9
Compare
Collaborator
51fe7f9 to
d147f66
Compare
notmandatory
commented
Jul 28, 2023
ebb9f82 to
40d5af3
Compare
19 tasks
danielabrozzoni
approved these changes
Jul 31, 2023
Member
danielabrozzoni
left a comment
There was a problem hiding this comment.
I just have a nit
ACK 40d5af3
16452c5 to
1667496
Compare
Member
Author
|
@LLFourn continuing #1015 (comment) here. Are you ok with the name I'm now calling the |
LLFourn
reviewed
Aug 1, 2023
LLFourn
reviewed
Aug 1, 2023
Collaborator
LLFourn
left a comment
There was a problem hiding this comment.
Concept ACK. See minor comments.
LLFourn
reviewed
Aug 21, 2023
30 tasks
346521c to
f1d868d
Compare
evanlinjin
reviewed
Aug 29, 2023
f1d868d to
b3cbfb9
Compare
Added - Wallet::sent_and_received function - Wallet::calculate_fee and Wallet::calculate_fee_rate functions - Wallet::error::CalculateFeeError BREAKING CHANGES: Removed - TransactionDetails struct Changed - Wallet::get_tx now returns CanonicalTx instead of TransactionDetails - TxBuilder::finish now returns only a PartiallySignedTransaction
…alculateFeeError> added - tx_graph::CalculateFeeError enum BREAKING CHANGES: changed - TxGraph::calculate_fee function to return Result<u64,CalculateFeeError> instead of Option<i64>
…fee functions
added
- Wallet::insert_txout function to allow inserting foreign TxOuts
- test to verify error when trying to calculate fee with missing foreign utxo
- test to calculate fee with inserted foreign utxo
updated
- docs for Wallet::calculate_fee, Wallet::calculate_fee_rate, and TxGraph::calculate_fee
with note about missing foreign utxos
b3cbfb9 to
2f9318d
Compare
Member
Author
|
I've rebased, fixed docs and fixed a new MSRV issue. Just need @evanlinjin to ACK and then I'll merge, which will also fix |
…f psbt.fee_amount() - removed test_calculate_fee_with_inserted_foreign_utxo() since it now duplicates test in test_add_foreign_utxo()
2f9318d to
5fb5061
Compare
This was referenced Aug 31, 2023
Closed
41 tasks
8 tasks
8 tasks
This was referenced Dec 9, 2024
notmandatory
added a commit
that referenced
this pull request
Dec 23, 2024
…te_tx a2f7a8b refactor(wallet): cleanup and remove unused code in create_tx (Steve Myers) Pull request description: ### Description Cleanup and remove unused code in `Wallet::create_tx`, this was noticed during review of #1763. See: #1763 (comment) fixes #1710 ### Notes to the reviewers In addition to removing the unneeded assignments to `fee_amount` and `received` I also refactored creation of the change output to be an `if let` instead of `match` statement since it only needs to do something if there is `Excess::Change`. I should have done this cleanup as part of #1048. ### Changelog notice None, only internal cleanup. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: ValuedMammal: reACK a2f7a8b Tree-SHA512: 64e5895ff3dc11f71c48b6c436d5c812504d0a24e92f1fdf451936f372d95ccdd8d89e5ac634a041bdee0a4836182f05127864ed744d560c9f8ec560e092c559
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
Removed
TransactionDetailsand changedWallet::get_txto return aCanonicalTx, andTxBuilder::finishto return only aPartiallySignedTransaction. This should fix #922 and fix #1015.I also added
Walletfunctions to get aTransactionsend and receive amounts, fee, andFeeRate.see: #922 (comment)
Notes to the reviewers
Alot of wallet tests had to change since
TxBuilder::finishonly returns a PSBT now.I added a new
CalculateFeeErrorwhich follows changes coming in #1028.Changelog notice
Added
BREAKING CHANGES:
Removed
Changed
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: