Skip to content

Commit 151add8

Browse files
committed
Rename PsbtParams
1 parent 0fee2a2 commit 151add8

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

wallet/examples/psbt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::Arc;
88
use bdk_chain::BlockId;
99
use bdk_chain::ConfirmationBlockTime;
1010
use bdk_chain::TxUpdate;
11-
use bdk_wallet::psbt::params::{Params, SelectionStrategy::*};
11+
use bdk_wallet::psbt::{PsbtParams, SelectionStrategy::*};
1212
use bdk_wallet::test_utils::*;
1313
use bdk_wallet::{KeychainKind::*, Update, Wallet};
1414
use bitcoin::FeeRate;
@@ -49,7 +49,7 @@ fn main() -> anyhow::Result<()> {
4949
.collect::<HashMap<_, _>>();
5050

5151
// Build params.
52-
let mut params = Params::default();
52+
let mut params = PsbtParams::default();
5353
let addr = Address::from_str(SEND_TO)?.require_network(NETWORK)?;
5454
let feerate = feerate_unchecked(FEERATE);
5555
params

wallet/src/psbt/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ use bitcoin::FeeRate;
1717
use bitcoin::Psbt;
1818
use bitcoin::TxOut;
1919

20-
#[allow(unused)]
21-
pub mod params;
20+
mod params;
21+
22+
pub use params::*;
2223

2324
// TODO upstream the functions here to `rust-bitcoin`?
2425

wallet/src/psbt/params.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use miniscript::plan::Assets;
88

99
/// Parameters to create a PSBT.
1010
#[derive(Debug)]
11-
pub struct Params {
11+
#[allow(unused)]
12+
pub struct PsbtParams {
1213
// Inputs
1314
pub(crate) utxos: Vec<OutPoint>,
1415

@@ -29,7 +30,7 @@ pub struct Params {
2930
pub(crate) fallback_sequence: Option<Sequence>,
3031
}
3132

32-
impl Default for Params {
33+
impl Default for PsbtParams {
3334
fn default() -> Self {
3435
Self {
3536
utxos: Default::default(),
@@ -47,8 +48,8 @@ impl Default for Params {
4748
}
4849
}
4950

50-
// TODO: more setters for Params
51-
impl Params {
51+
// TODO: more setters for PsbtParams
52+
impl PsbtParams {
5253
/// Add the spend [`Assets`].
5354
///
5455
/// Assets are required to create a spending plan for an output controlled by the wallet's

wallet/src/wallet/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,7 @@ use bdk_tx::{
26392639
};
26402640
use miniscript::plan::{Assets, Plan};
26412641

2642-
use crate::psbt::params::{self as psbt_params, AssetsExt, SelectionStrategy};
2642+
use crate::psbt::{AssetsExt, SelectionStrategy};
26432643

26442644
/// Maps a chain position to tx confirmation status, if `pos` is the confirmed
26452645
/// variant.
@@ -2687,7 +2687,7 @@ impl Wallet {
26872687
/// Create PSBT with the given `params` and `rng`.
26882688
pub fn create_psbt(
26892689
&self,
2690-
params: psbt_params::Params,
2690+
params: crate::psbt::PsbtParams,
26912691
rng: &mut impl RngCore,
26922692
) -> Result<(Psbt, Finalizer), CreatePsbtError> {
26932693
// Get spend assets

0 commit comments

Comments
 (0)