From: 志宇 Date: Thu, 31 Aug 2023 05:29:01 +0000 (+0800) Subject: Merge bitcoindevkit/bdk#1048: Remove TransactionDetails from Wallet API X-Git-Tag: v1.0.0-alpha.2~18 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CodeLengthError.html?a=commitdiff_plain;h=93e8eaf7ee950d988abf994916d78ee3192f14ed;p=bdk Merge bitcoindevkit/bdk#1048: Remove TransactionDetails from Wallet API 5fb5061645ae92d37091a215e48e84423fea48a3 ci: fix msrv dependency versions for rustls (Steve Myers) dd5b8d759954f39baa4523fa10b4a64efe48a25b test(wallet): add check_fee!(wallet,psbt) macro and use it in place of psbt.fee_amount() (Steve Myers) 465d53cc88b32bf8098dc61e9afdbb28d22b213d docs(wallet): update docs for calculate_fee/fee_rate and add_foreign_utxo (Steve Myers) 036299803f9f94c7c8218a75f3c206fa8c4297ab feat(wallet): add Wallet::insert_txout function and updated docs for fee functions (Steve Myers) d443fe7f6613776a3dce00def0b655c4b2b36728 feat(tx_graph)!: change TxGraph::calculate_fee to return Result (Steve Myers) b4c31cd5bad4fea18044aab2cffd657b16ec185b feat(wallet)!: remove TransactionDetails from bdk::Wallet API (Steve Myers) Pull request description: ### Description Removed `TransactionDetails` and changed `Wallet::get_tx` to return a `CanonicalTx`, and `TxBuilder::finish` to return only a `PartiallySignedTransaction`. This should fix #922 and fix #1015. I also added `Wallet` functions to get a `Transaction` send and receive amounts, fee, and `FeeRate`. see: https://github.com/bitcoindevkit/bdk/issues/922#issuecomment-1652814975 ### Notes to the reviewers Alot of wallet tests had to change since `TxBuilder::finish` only returns a PSBT now. I added a new `CalculateFeeError` which follows changes coming in #1028. ### Changelog notice Added - Wallet::sent_and_received function - Wallet::calculate_fee and Wallet::calculate_fee_rate functions - Wallet::error::CalculateFeeError - Wallet::insert_txout function to allow inserting foreign TxOuts BREAKING CHANGES: Removed - TransactionDetails struct Changed - Wallet::get_tx now returns CanonicalTx instead of TransactionDetails - TxBuilder::finish now returns only a PartiallySignedTransaction ### 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 #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: evanlinjin: ACK 5fb5061645ae92d37091a215e48e84423fea48a3 Tree-SHA512: 1a0be1c229b8871e5ee23ba6874ff40370170477a0a8bb104c0197e7fd97765d84854285f863dd1b38a34c3b71815e75e4db5b25288c81caea99a14ddaa78254 --- 93e8eaf7ee950d988abf994916d78ee3192f14ed