pub fn witness_script(&self) -> Script {
        match *self {
            Descriptor::Bare(..)
            | Descriptor::Pk(..)
            | Descriptor::Pkh(..)
            | Descriptor::Wpkh(..) => self.script_pubkey(),
            Descriptor::ShWpkh(ref pk) => {
                let addr =
                    elements::Address::p2wpkh(&pk.to_public_key(), None, &AddressParams::ELEMENTS);
                addr.script_pubkey()
            }
            Descriptor::Sh(ref d) => d.encode(),
            Descriptor::Wsh(ref d) | Descriptor::ShWsh(ref d) => d.encode(),
            Descriptor::Cov(ref cov) => cov.commit_ctx.script_pubkey(),
        }
    }
/// Computes the "witness script" of the descriptor, i.e. the underlying
/// script before any hashing is done. For `Bare`, `Pkh` and `Wpkh` this
/// is the scriptPubkey; for `ShWpkh` and `Sh` this is the redeemScript;
/// for the others it is the witness script.
Computes the "witness script" of the descriptor, i.e. the underlying
script before any hashing is done.
Computes the " witness script " of the descriptor i . e . the underlying script before any hashing is done .
pub fn witness_script(&self) -> Script {
        match *self {
            Descriptor::Bare(..)
            | Descriptor::Pk(..)
            | Descriptor::Pkh(..)
            | Descriptor::Wpkh(..) => self.script_pubkey(),
            Descriptor::ShWpkh(ref pk) => {
                let addr =
                    elements::Address::p2wpkh(&pk.to_public_key(), None, &AddressParams::ELEMENTS);
                addr.script_pubkey()
            }
            Descriptor::Sh(ref d) => d.encode(),
            Descriptor::Wsh(ref d) | Descriptor::ShWsh(ref d) => d.encode(),
            Descriptor::Cov(ref cov) => cov.commit_ctx.script_pubkey(),
        }
    }
pub fn witness_script ( & self ) -> Script { match * self { Descriptor :: Bare ( .. ) | Descriptor :: Pk ( .. ) | Descriptor :: Pkh ( .. ) | Descriptor :: Wpkh ( .. ) => self . script_pubkey ( ) , Descriptor :: ShWpkh ( ref pk ) => { let addr = elements :: Address :: p2wpkh ( & pk . to_public_key ( ) , None , & AddressParams :: ELEMENTS ) ; addr . script_pubkey ( ) } Descriptor :: Sh ( ref d ) => d . encode ( ) , Descriptor :: Wsh ( ref d ) | Descriptor :: ShWsh ( ref d ) => d . encode ( ) , Descriptor :: Cov ( ref cov ) => cov . commit_ctx . script_pubkey ( ) , } }
Computes the "witness script" of the descriptor, i.e.
Computes the " witness script " of the descriptor i . e .
&self
&self