@@ -390,7 +390,8 @@ impl hash::Hash for DummySha256Hash {
390
390
}
391
391
}
392
392
393
- /// Provides the conversion information required in [`TranslatePk`]
393
+ /// Describes an object that can translate various keys and hashes from one key to the type
394
+ /// associated with the other key. Used by the [`TranslatePk`] trait to do the actual translations.
394
395
pub trait Translator < P , Q , E >
395
396
where
396
397
P : MiniscriptKey ,
@@ -440,12 +441,8 @@ where
440
441
}
441
442
}
442
443
443
- /// Converts a descriptor using abstract keys to one using specific keys.
444
- ///
445
- /// # Panics
446
- ///
447
- /// If `fpk` returns an uncompressed key when converting to a segwit descriptor.
448
- /// To prevent this panic, ensure `fpk` returns an error in this case instead.
444
+ /// Converts a descriptor using abstract keys to one using specific keys. Uses translator `t` to do
445
+ /// the actual translation function calls.
449
446
pub trait TranslatePk < P , Q >
450
447
where
451
448
P : MiniscriptKey ,
@@ -454,9 +451,8 @@ where
454
451
/// The associated output type. This must be `Self<Q>`.
455
452
type Output ;
456
453
457
- /// Translates a struct from one generic to another where the translation
458
- /// for Pk is provided by function `fpk`, and translation for PkH is
459
- /// provided by function `fpkh`.
454
+ /// Translates a struct from one generic to another where the translations
455
+ /// for Pk are provided by the given [`Translator`].
460
456
fn translate_pk < T , E > ( & self , translator : & mut T ) -> Result < Self :: Output , E >
461
457
where
462
458
T : Translator < P , Q , E > ;
0 commit comments