fn validate(
    transaction: Transaction,
    height: block::Height,
    block_time: DateTime<Utc>,
    known_utxos: HashMap<transparent::OutPoint, transparent::OrderedUtxo>,
    network: Network,
) -> Result<transaction::Response, TransactionError> {
    zebra_test::RUNTIME.block_on(async {
        // Initialize the verifier
        let state_service =
            tower::service_fn(|_| async { unreachable!("State service should not be called") });
        let script_verifier = script::Verifier::new(state_service);
        let verifier = transaction::Verifier::new(network, script_verifier);

        // Test the transaction verifier
        verifier
            .clone()
            .oneshot(transaction::Request::Block {
                transaction: Arc::new(transaction),
                known_utxos: Arc::new(known_utxos),
                height,
                time: block_time,
            })
            .await
    })
}
/// Validate a `transaction` using a [`transaction::Verifier`] and return the result.
///
/// Configures an asynchronous runtime to run the verifier, sets it up and then uses it verify a
/// `transaction` using the provided parameters.
Validate a `transaction` using a [`transaction::Verifier`] and return the result.
Configures an asynchronous runtime to run the verifier, sets it up and then uses it verify a
`transaction` using the provided parameters.
Validate a ` transaction ` using a [ ` transaction :: Verifier ` ] and return the result . Configures an asynchronous runtime to run the verifier sets it up and then uses it verify a ` transaction ` using the provided parameters .
fn validate(
    transaction: Transaction,
    height: block::Height,
    block_time: DateTime<Utc>,
    known_utxos: HashMap<transparent::OutPoint, transparent::OrderedUtxo>,
    network: Network,
) -> Result<transaction::Response, TransactionError> {
    zebra_test::RUNTIME.block_on(async {
        // Initialize the verifier
        let state_service =
            tower::service_fn(|_| async { unreachable!("State service should not be called") });
        let script_verifier = script::Verifier::new(state_service);
        let verifier = transaction::Verifier::new(network, script_verifier);
        // Test the transaction verifier
        verifier
            .clone()
            .oneshot(transaction::Request::Block {
                transaction: Arc::new(transaction),
                known_utxos: Arc::new(known_utxos),
                height,
                time: block_time,
            })
            .await
    })
}
fn validate ( transaction : Transaction , height : block :: Height , block_time : DateTime < Utc > , known_utxos : HashMap < transparent :: OutPoint , transparent :: OrderedUtxo > , network : Network , ) -> Result < transaction :: Response , TransactionError > { zebra_test :: RUNTIME . block_on ( async { // Initialize the verifier let state_service = tower :: service_fn ( | _ | async { unreachable ! ( " " ) } ) ; let script_verifier = script :: Verifier :: new ( state_service ) ; let verifier = transaction :: Verifier :: new ( network , script_verifier ) ; // Test the transaction verifier verifier . clone ( ) . oneshot ( transaction :: Request :: Block { transaction : Arc :: new ( transaction ) , known_utxos : Arc :: new ( known_utxos ) , height , time : block_time , } ) . await } ) }
Validate a `transaction` using a [`transaction::Verifier`] and return the result.
Validate a ` transaction ` using a [ ` transaction :: Verifier ` ] and return the result .
transaction
Transaction
height
block::Height
block_time
DateTime<Utc>
known_utxos
HashMap<transparent::OutPoint, transparent::OrderedUtxo>
network
Network