pub fn verify_script(previous_tx_out: &[u8], transaction: &[u8], input: u32) -> Result<(), VerifyScriptError> {
    let flags = 0;
    let mut err: i32 = 0;
    let result = unsafe { bitcoinconsensus_verify_script(
        previous_tx_out.as_ptr(),
        previous_tx_out.len()  as u32,
        transaction.as_ptr(),
        transaction.len() as u32,
        input as u32,
        flags,
        &mut err
    ) };

    if result == 1 {
        Ok(())
    }
    else {
        Err(match err {
            0 => VerifyScriptError::Index,
            1 => VerifyScriptError::SizeMismatch,
            2  => VerifyScriptError::Deserialize,
            3  => VerifyScriptError::AmountRequired,
            4  => VerifyScriptError::InvalidFlags,
            _ => unreachable!()
        })
    }
}
/// Verifies whether the given `input` of the transaction spends the given `output`
/// using libbitcoin-consensus
Verifies whether the given `input` of the transaction spends the given `output`
using libbitcoin-consensus
Verifies whether the given ` input ` of the transaction spends the given ` output ` using libbitcoin - consensus
pub fn verify_script(previous_tx_out: &[u8], transaction: &[u8], input: u32) -> Result<(), VerifyScriptError> {
    let flags = 0;
    let mut err: i32 = 0;
    let result = unsafe { bitcoinconsensus_verify_script(
        previous_tx_out.as_ptr(),
        previous_tx_out.len()  as u32,
        transaction.as_ptr(),
        transaction.len() as u32,
        input as u32,
        flags,
        &mut err
    ) };
    if result == 1 {
        Ok(())
    }
    else {
        Err(match err {
            0 => VerifyScriptError::Index,
            1 => VerifyScriptError::SizeMismatch,
            2  => VerifyScriptError::Deserialize,
            3  => VerifyScriptError::AmountRequired,
            4  => VerifyScriptError::InvalidFlags,
            _ => unreachable!()
        })
    }
}
pub fn verify_script ( previous_tx_out : & [ u8 ] , transaction : & [ u8 ] , input : u32 ) -> Result < ( ) , VerifyScriptError > { let flags = 0 ; let mut err : i32 = 0 ; let result = unsafe { bitcoinconsensus_verify_script ( previous_tx_out . as_ptr ( ) , previous_tx_out . len ( ) as u32 , transaction . as_ptr ( ) , transaction . len ( ) as u32 , input as u32 , flags , & mut err ) } ; if result == 1 { Ok ( ( ) ) } else { Err ( match err { 0 => VerifyScriptError :: Index , 1 => VerifyScriptError :: SizeMismatch , 2 => VerifyScriptError :: Deserialize , 3 => VerifyScriptError :: AmountRequired , 4 => VerifyScriptError :: InvalidFlags , _ => unreachable ! ( ) } ) } }
Verifies whether the given `input` of the transaction spends the given `output`
using libbitcoin-consensus
Verifies whether the given ` input ` of the transaction spends the given ` output ` using libbitcoin - consensus
previous_tx_out
&[u8]
transaction
&[u8]
input
u32
previous_tx_out
&[u8]
transaction
&[u8]
input
u32