@@ -43,8 +43,7 @@ use self::lex::{lex, TokenIter};
43
43
pub use crate :: miniscript:: context:: ScriptContext ;
44
44
use crate :: miniscript:: decode:: Terminal ;
45
45
use crate :: {
46
- expression, plan, Error , ForEachKey , FromStrKey , MiniscriptKey , ToPublicKey , TranslatePk ,
47
- Translator ,
46
+ expression, plan, Error , ForEachKey , FromStrKey , MiniscriptKey , ToPublicKey , Translator ,
48
47
} ;
49
48
#[ cfg( test) ]
50
49
mod ms_tests;
@@ -514,25 +513,17 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Miniscript<Pk, Ct
514
513
}
515
514
}
516
515
517
- impl < Pk , Q , Ctx > TranslatePk < Pk , Q > for Miniscript < Pk , Ctx >
518
- where
519
- Pk : MiniscriptKey ,
520
- Q : MiniscriptKey ,
521
- Ctx : ScriptContext ,
522
- {
523
- type Output = Miniscript < Q , Ctx > ;
524
-
516
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > Miniscript < Pk , Ctx > {
525
517
/// Translates a struct from one generic to another where the translation
526
518
/// for Pk is provided by [`Translator`]
527
- fn translate_pk < T , E > ( & self , t : & mut T ) -> Result < Self :: Output , TranslateErr < E > >
519
+ pub fn translate_pk < Q , T , E > ( & self , t : & mut T ) -> Result < Miniscript < Q , Ctx > , TranslateErr < E > >
528
520
where
529
521
T : Translator < Pk , Q , E > ,
522
+ Q : MiniscriptKey ,
530
523
{
531
524
self . translate_pk_ctx ( t)
532
525
}
533
- }
534
526
535
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > Miniscript < Pk , Ctx > {
536
527
pub ( super ) fn translate_pk_ctx < Q , CtxQ , T , FuncError > (
537
528
& self ,
538
529
t : & mut T ,
@@ -837,7 +828,7 @@ mod tests {
837
828
use crate :: policy:: Liftable ;
838
829
use crate :: prelude:: * ;
839
830
use crate :: test_utils:: { StrKeyTranslator , StrXOnlyKeyTranslator } ;
840
- use crate :: { hex_script, Error , ExtParams , RelLockTime , Satisfier , ToPublicKey , TranslatePk } ;
831
+ use crate :: { hex_script, Error , ExtParams , RelLockTime , Satisfier , ToPublicKey } ;
841
832
842
833
type Segwitv0Script = Miniscript < bitcoin:: PublicKey , Segwitv0 > ;
843
834
type Tapscript = Miniscript < bitcoin:: secp256k1:: XOnlyPublicKey , Tap > ;
0 commit comments