pub fn new(transaction: Arc<Transaction>) -> Self {
        let tx_to = transaction
            .zcash_serialize_to_vec()
            .expect("serialization into a vec is infallible");

        let tx_to_ptr = tx_to.as_ptr();
        let tx_to_len = tx_to
            .len()
            .try_into()
            .expect("serialized transaction lengths are much less than u32::MAX");
        let mut err = 0;

        // SAFETY: the `tx_to_*` fields are created from a valid Rust `Vec`.
        let precomputed = unsafe {
            zcash_script::zcash_script_new_precomputed_tx(tx_to_ptr, tx_to_len, &mut err)
        };
        // SAFETY: the safety of other methods depends on `precomputed` being valid and not NULL.
        assert!(
            !precomputed.is_null(),
            "zcash_script_new_precomputed_tx returned {} ({})",
            err,
            Error::from(err)
        );

        Self {
            transaction,
            // SAFETY: `precomputed` must not be modified after initialisation,
            //          so that it is `Send` and `Sync`.
            precomputed,
        }
    }
/// Construct a `PrecomputedTransaction` from a `Transaction`.
Construct a `PrecomputedTransaction` from a `Transaction`.
Construct a ` PrecomputedTransaction ` from a ` Transaction ` .
pub fn new(transaction: Arc<Transaction>) -> Self {
        let tx_to = transaction
            .zcash_serialize_to_vec()
            .expect("serialization into a vec is infallible");
        let tx_to_ptr = tx_to.as_ptr();
        let tx_to_len = tx_to
            .len()
            .try_into()
            .expect("serialized transaction lengths are much less than u32::MAX");
        let mut err = 0;
        // SAFETY: the `tx_to_*` fields are created from a valid Rust `Vec`.
        let precomputed = unsafe {
            zcash_script::zcash_script_new_precomputed_tx(tx_to_ptr, tx_to_len, &mut err)
        };
        // SAFETY: the safety of other methods depends on `precomputed` being valid and not NULL.
        assert!(
            !precomputed.is_null(),
            "zcash_script_new_precomputed_tx returned {} ({})",
            err,
            Error::from(err)
        );
        Self {
            transaction,
            // SAFETY: `precomputed` must not be modified after initialisation,
            //          so that it is `Send` and `Sync`.
            precomputed,
        }
    }
pub fn new ( transaction : Arc < Transaction > ) -> Self { let tx_to = transaction . zcash_serialize_to_vec ( ) . expect ( " " ) ; let tx_to_ptr = tx_to . as_ptr ( ) ; let tx_to_len = tx_to . len ( ) . try_into ( ) . expect ( " " ) ; let mut err = 0 ; // SAFETY: the `tx_to_*` fields are created from a valid Rust `Vec`. let precomputed = unsafe { zcash_script :: zcash_script_new_precomputed_tx ( tx_to_ptr , tx_to_len , & mut err ) } ; // SAFETY: the safety of other methods depends on `precomputed` being valid and not NULL. assert ! ( precomputed is_null ( ) " " err Error from ( err ) ) ; Self { transaction , // SAFETY: `precomputed` must not be modified after initialisation, //          so that it is `Send` and `Sync`. precomputed , } }
Construct a `PrecomputedTransaction` from a `Transaction`.
Construct a ` PrecomputedTransaction ` from a ` Transaction ` .
transaction
Arc<Transaction>