File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use std::sync::Arc;
8
8
use bdk_chain:: BlockId ;
9
9
use bdk_chain:: ConfirmationBlockTime ;
10
10
use bdk_chain:: TxUpdate ;
11
- use bdk_wallet:: psbt:: params :: { Params , SelectionStrategy :: * } ;
11
+ use bdk_wallet:: psbt:: { PsbtParams , SelectionStrategy :: * } ;
12
12
use bdk_wallet:: test_utils:: * ;
13
13
use bdk_wallet:: { KeychainKind :: * , Update , Wallet } ;
14
14
use bitcoin:: FeeRate ;
@@ -49,7 +49,7 @@ fn main() -> anyhow::Result<()> {
49
49
. collect :: < HashMap < _ , _ > > ( ) ;
50
50
51
51
// Build params.
52
- let mut params = Params :: default ( ) ;
52
+ let mut params = PsbtParams :: default ( ) ;
53
53
let addr = Address :: from_str ( SEND_TO ) ?. require_network ( NETWORK ) ?;
54
54
let feerate = feerate_unchecked ( FEERATE ) ;
55
55
params
Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ use bitcoin::FeeRate;
17
17
use bitcoin:: Psbt ;
18
18
use bitcoin:: TxOut ;
19
19
20
- #[ allow( unused) ]
21
- pub mod params;
20
+ mod params;
21
+
22
+ pub use params:: * ;
22
23
23
24
// TODO upstream the functions here to `rust-bitcoin`?
24
25
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ use miniscript::plan::Assets;
8
8
9
9
/// Parameters to create a PSBT.
10
10
#[ derive( Debug ) ]
11
- pub struct Params {
11
+ #[ allow( unused) ]
12
+ pub struct PsbtParams {
12
13
// Inputs
13
14
pub ( crate ) utxos : Vec < OutPoint > ,
14
15
@@ -29,7 +30,7 @@ pub struct Params {
29
30
pub ( crate ) fallback_sequence : Option < Sequence > ,
30
31
}
31
32
32
- impl Default for Params {
33
+ impl Default for PsbtParams {
33
34
fn default ( ) -> Self {
34
35
Self {
35
36
utxos : Default :: default ( ) ,
@@ -47,8 +48,8 @@ impl Default for Params {
47
48
}
48
49
}
49
50
50
- // TODO: more setters for Params
51
- impl Params {
51
+ // TODO: more setters for PsbtParams
52
+ impl PsbtParams {
52
53
/// Add the spend [`Assets`].
53
54
///
54
55
/// Assets are required to create a spending plan for an output controlled by the wallet's
Original file line number Diff line number Diff line change @@ -2639,7 +2639,7 @@ use bdk_tx::{
2639
2639
} ;
2640
2640
use miniscript:: plan:: { Assets , Plan } ;
2641
2641
2642
- use crate :: psbt:: params :: { self as psbt_params , AssetsExt , SelectionStrategy } ;
2642
+ use crate :: psbt:: { AssetsExt , SelectionStrategy } ;
2643
2643
2644
2644
/// Maps a chain position to tx confirmation status, if `pos` is the confirmed
2645
2645
/// variant.
@@ -2687,7 +2687,7 @@ impl Wallet {
2687
2687
/// Create PSBT with the given `params` and `rng`.
2688
2688
pub fn create_psbt (
2689
2689
& self ,
2690
- params : psbt_params :: Params ,
2690
+ params : crate :: psbt :: PsbtParams ,
2691
2691
rng : & mut impl RngCore ,
2692
2692
) -> Result < ( Psbt , Finalizer ) , CreatePsbtError > {
2693
2693
// Get spend assets
You can’t perform that action at this time.
0 commit comments