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

The associated output type. This must be Self

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

Provided Methods

Calls translate_pk with conversion functions that cannot fail

Implementors