Trait miniscript::TranslatePk
source · [−]pub trait TranslatePk<P: MiniscriptKey, Q: MiniscriptKey> {
type Output;
fn translate_pk<Fpk, Fpkh, E>(
&self,
translatefpk: Fpk,
translatefpkh: Fpkh
) -> Result<Self::Output, E>
where
Fpk: FnMut(&P) -> Result<Q, E>,
Fpkh: FnMut(&P::Hash) -> Result<Q::Hash, E>;
fn translate_pk_infallible<Fpk, Fpkh>(
&self,
translatefpk: Fpk,
translatefpkh: Fpkh
) -> Self::Output
where
Fpk: FnMut(&P) -> Q,
Fpkh: FnMut(&P::Hash) -> Q::Hash,
{ ... }
}
Expand description
Convert a descriptor using abstract keys to one using specific keys This will panic if translatefpk returns an uncompressed key when converting to a Segwit descriptor. To prevent this panic, ensure translatefpk returns an error in this case instead.
Required Associated Types
Required Methods
Translate a struct from one Generic to another where the translation for Pk is provided by translatefpk, and translation for PkH is provided by translatefpkh