File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
example-crates/example_cli/src Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11use crate :: miniscript:: { Descriptor , DescriptorPublicKey } ;
22use bitcoin:: hashes:: { hash_newtype, sha256, Hash } ;
3+ use bitcoin:: Amount ;
34
45hash_newtype ! {
56 /// Represents the unique ID of a descriptor.
@@ -13,22 +14,21 @@ hash_newtype! {
1314
1415/// A trait to extend the functionality of a miniscript descriptor.
1516pub trait DescriptorExt {
16- /// Returns the minimum value (in satoshis) at which an output is broadcastable .
17+ /// Returns the minimum [`Amount`] at which an output is broadcast-able .
1718 /// Panics if the descriptor wildcard is hardened.
18- fn dust_value ( & self ) -> u64 ;
19+ fn dust_value ( & self ) -> Amount ;
1920
2021 /// Returns the descriptor ID, calculated as the sha256 hash of the spk derived from the
2122 /// descriptor at index 0.
2223 fn descriptor_id ( & self ) -> DescriptorId ;
2324}
2425
2526impl DescriptorExt for Descriptor < DescriptorPublicKey > {
26- fn dust_value ( & self ) -> u64 {
27+ fn dust_value ( & self ) -> Amount {
2728 self . at_derivation_index ( 0 )
2829 . expect ( "descriptor can't have hardened derivation" )
2930 . script_pubkey ( )
3031 . minimal_non_dust ( )
31- . to_sat ( )
3232 }
3333
3434 fn descriptor_id ( & self ) -> DescriptorId {
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ where
324324 . expect ( "must exist" )
325325 . 1 ;
326326
327- let min_drain_value = change_desc. dust_value ( ) ;
327+ let min_drain_value = change_desc. dust_value ( ) . to_sat ( ) ;
328328
329329 let target = Target {
330330 outputs : TargetOutputs :: fund_outputs (
You can’t perform that action at this time.
0 commit comments