@@ -22,11 +22,12 @@ use bitcoin::{secp256k1, Address, Network, Script, ScriptBuf, TxIn, Witness};
22
22
use sync:: Arc ;
23
23
24
24
use self :: checksum:: verify_checksum;
25
+ use crate :: miniscript:: decode:: Terminal ;
25
26
use crate :: miniscript:: { Legacy , Miniscript , Segwitv0 } ;
26
27
use crate :: prelude:: * ;
27
28
use crate :: {
28
- expression, hash256, miniscript , BareCtx , Error , ForEachKey , MiniscriptKey , Satisfier ,
29
- ToPublicKey , TranslateErr , TranslatePk , Translator ,
29
+ expression, hash256, BareCtx , Error , ForEachKey , MiniscriptKey , Satisfier , ToPublicKey ,
30
+ TranslateErr , TranslatePk , Translator ,
30
31
} ;
31
32
32
33
mod bare;
@@ -167,12 +168,10 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
167
168
/// Create a new pk descriptor
168
169
pub fn new_pk ( pk : Pk ) -> Self {
169
170
// roundabout way to constuct `c:pk_k(pk)`
170
- let ms: Miniscript < Pk , BareCtx > =
171
- Miniscript :: from_ast ( miniscript:: decode:: Terminal :: Check ( Arc :: new (
172
- Miniscript :: from_ast ( miniscript:: decode:: Terminal :: PkK ( pk) )
173
- . expect ( "Type check cannot fail" ) ,
174
- ) ) )
175
- . expect ( "Type check cannot fail" ) ;
171
+ let ms: Miniscript < Pk , BareCtx > = Miniscript :: from_ast ( Terminal :: Check ( Arc :: new (
172
+ Miniscript :: from_ast ( Terminal :: PkK ( pk) ) . expect ( "Type check cannot fail" ) ,
173
+ ) ) )
174
+ . expect ( "Type check cannot fail" ) ;
176
175
Descriptor :: Bare ( Bare :: new ( ms) . expect ( "Context checks cannot fail for p2pk" ) )
177
176
}
178
177
0 commit comments