pub fn script_code(&self) -> Script {
        match *self {
            // For "legacy" non-P2SH outputs, it is defined as the txo's scriptPubKey.
            Descriptor::Bare(..) | Descriptor::Pk(..) | Descriptor::Pkh(..) => self.script_pubkey(),
            // For "legacy" P2SH outputs, it is defined as the txo's redeemScript.
            Descriptor::Sh(ref d) => d.encode(),
            // For SegWit outputs, it is defined by bip-0143 (quoted below) and is different from
            // the previous txo's scriptPubKey.
            // The item 5:
            //     - For P2WPKH witness program, the scriptCode is `0x1976a914{20-byte-pubkey-hash}88ac`.
            Descriptor::Wpkh(ref pk) | Descriptor::ShWpkh(ref pk) => {
                let addr =
                    elements::Address::p2pkh(&pk.to_public_key(), None, &&AddressParams::ELEMENTS);
                addr.script_pubkey()
            }
            //     - For P2WSH witness program, if the witnessScript does not contain any `OP_CODESEPARATOR`,
            //       the `scriptCode` is the `witnessScript` serialized as scripts inside CTxOut.
            Descriptor::Wsh(ref d) | Descriptor::ShWsh(ref d) => d.encode(),
            Descriptor::Cov(ref cov) => cov.commit_ctx.script_pubkey(),
        }
    }
/// Get the `scriptCode` of a transaction output.
///
/// The `scriptCode` is the Script of the previous transaction output being serialized in the
/// sighash when evaluating a `CHECKSIG` & co. OP code.
Get the `scriptCode` of a transaction output.
The `scriptCode` is the Script of the previous transaction output being serialized in the
sighash when evaluating a `CHECKSIG` & co. OP code.
Get the ` scriptCode ` of a transaction output . The ` scriptCode ` is the Script of the previous transaction output being serialized in the sighash when evaluating a ` CHECKSIG ` & co . OP code .
pub fn script_code(&self) -> Script {
        match *self {
            // For "legacy" non-P2SH outputs, it is defined as the txo's scriptPubKey.
            Descriptor::Bare(..) | Descriptor::Pk(..) | Descriptor::Pkh(..) => self.script_pubkey(),
            // For "legacy" P2SH outputs, it is defined as the txo's redeemScript.
            Descriptor::Sh(ref d) => d.encode(),
            // For SegWit outputs, it is defined by bip-0143 (quoted below) and is different from
            // the previous txo's scriptPubKey.
            // The item 5:
            //     - For P2WPKH witness program, the scriptCode is `0x1976a914{20-byte-pubkey-hash}88ac`.
            Descriptor::Wpkh(ref pk) | Descriptor::ShWpkh(ref pk) => {
                let addr =
                    elements::Address::p2pkh(&pk.to_public_key(), None, &&AddressParams::ELEMENTS);
                addr.script_pubkey()
            }
            //     - For P2WSH witness program, if the witnessScript does not contain any `OP_CODESEPARATOR`,
            //       the `scriptCode` is the `witnessScript` serialized as scripts inside CTxOut.
            Descriptor::Wsh(ref d) | Descriptor::ShWsh(ref d) => d.encode(),
            Descriptor::Cov(ref cov) => cov.commit_ctx.script_pubkey(),
        }
    }
pub fn script_code ( & self ) -> Script { match * self { // For "legacy" non-P2SH outputs, it is defined as the txo's scriptPubKey. Descriptor :: Bare ( .. ) | Descriptor :: Pk ( .. ) | Descriptor :: Pkh ( .. ) => self . script_pubkey ( ) , // For "legacy" P2SH outputs, it is defined as the txo's redeemScript. Descriptor :: Sh ( ref d ) => d . encode ( ) , // For SegWit outputs, it is defined by bip-0143 (quoted below) and is different from // the previous txo's scriptPubKey. // The item 5: //     - For P2WPKH witness program, the scriptCode is `0x1976a914{20-byte-pubkey-hash}88ac`. Descriptor :: Wpkh ( ref pk ) | Descriptor :: ShWpkh ( ref pk ) => { let addr = elements :: Address :: p2pkh ( & pk . to_public_key ( ) , None , & & AddressParams :: ELEMENTS ) ; addr . script_pubkey ( ) } //     - For P2WSH witness program, if the witnessScript does not contain any `OP_CODESEPARATOR`, //       the `scriptCode` is the `witnessScript` serialized as scripts inside CTxOut. Descriptor :: Wsh ( ref d ) | Descriptor :: ShWsh ( ref d ) => d . encode ( ) , Descriptor :: Cov ( ref cov ) => cov . commit_ctx . script_pubkey ( ) , } }
Get the `scriptCode` of a transaction output.
Get the ` scriptCode ` of a transaction output .
&self
&self