fn signature<Pk: ToPublicKey, S: Satisfier<Pk>, Ctx: ScriptContext>(sat: S, pk: &Pk) -> Self {
        match Ctx::sig_type() {
            super::context::SigType::Ecdsa => match sat.lookup_ecdsa_sig(pk) {
                Some(sig) => Witness::Stack(vec![sig.to_vec()]),
                // Signatures cannot be forged
                None => Witness::Impossible,
            },
            super::context::SigType::Schnorr => match sat.lookup_schnorr_sig(pk) {
                Some(sig) => Witness::Stack(vec![sig.to_vec()]),
                // Signatures cannot be forged
                None => Witness::Impossible,
            },
        }
    }
/// Turn a signature into (part of) a satisfaction
Turn a signature into (part of) a satisfaction
Turn a signature into ( part of ) a satisfaction
fn signature<Pk: ToPublicKey, S: Satisfier<Pk>, Ctx: ScriptContext>(sat: S, pk: &Pk) -> Self {
        match Ctx::sig_type() {
            super::context::SigType::Ecdsa => match sat.lookup_ecdsa_sig(pk) {
                Some(sig) => Witness::Stack(vec![sig.to_vec()]),
                // Signatures cannot be forged
                None => Witness::Impossible,
            },
            super::context::SigType::Schnorr => match sat.lookup_schnorr_sig(pk) {
                Some(sig) => Witness::Stack(vec![sig.to_vec()]),
                // Signatures cannot be forged
                None => Witness::Impossible,
            },
        }
    }
fn signature < Pk : ToPublicKey , S : Satisfier < Pk > , Ctx : ScriptContext > ( sat : S , pk : & Pk ) -> Self { match Ctx :: sig_type ( ) { super :: context :: SigType :: Ecdsa => match sat . lookup_ecdsa_sig ( pk ) { Some ( sig ) => Witness :: Stack ( vec ! [ sig to_vec ( ) ] ) , // Signatures cannot be forged None => Witness :: Impossible , } , super :: context :: SigType :: Schnorr => match sat . lookup_schnorr_sig ( pk ) { Some ( sig ) => Witness :: Stack ( vec ! [ sig to_vec ( ) ] ) , // Signatures cannot be forged None => Witness :: Impossible , } , } }
Turn a signature into (part of) a satisfaction
Turn a signature into ( part of ) a satisfaction
sat
S
pk
&Pk
sat
S
pk
&Pk