Skip to content

Commit f2181f5

Browse files
committed
Merge #782: Make psbt mod public and add required docs
34987d5 Make psbt mod public and add required docs (Steve Myers) Pull request description: ### Description Make psbt mod public and add required docs. The module needs to be public so `bdk-ffi` can expose the new PSBT `fee_amount()` and `fee_rate()` functions. ### Notes to the reviewers I should have done this as part of #728. ### Changelog notice Make psbt module public to expose PsbtUtils trait to downstream projects. ### 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: * [ ] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: rajarshimaitra: Concept + tACK 34987d5 Tree-SHA512: 99e91e948bccb7593a3da3ac5468232103d4ba90ad4e5888ef6aebb0d16511ad3a3286951779789c05587b4bb996bc359baa28b0f4c3c55e29b24bfc12a10073
2 parents 1c76084 + 34987d5 commit f2181f5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub mod descriptor;
263263
#[cfg(feature = "test-md-docs")]
264264
mod doctest;
265265
pub mod keys;
266-
pub(crate) mod psbt;
266+
pub mod psbt;
267267
pub(crate) mod types;
268268
pub mod wallet;
269269

src/psbt/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99
// You may not use this file except in accordance with one or both of these
1010
// licenses.
1111

12+
//! Additional functions on the `rust-bitcoin` `PartiallySignedTransaction` structure.
13+
1214
use crate::FeeRate;
1315
use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;
1416
use bitcoin::TxOut;
1517

18+
// TODO upstream the functions here to `rust-bitcoin`?
19+
20+
/// Trait to add functions to extract utxos and calculate fees.
1621
pub trait PsbtUtils {
22+
/// Get the `TxOut` for the specified input index, if it doesn't exist in the PSBT `None` is returned.
1723
fn get_utxo_for(&self, input_index: usize) -> Option<TxOut>;
1824

1925
/// The total transaction fee amount, sum of input amounts minus sum of output amounts, in Sats.

0 commit comments

Comments
 (0)