async fn transaction_in_state(
        state: &mut ZS,
        txid: UnminedTxId,
    ) -> Result<(), TransactionDownloadVerifyError> {
        // Check if the transaction is already in the state.
        match state
            .ready()
            .await
            .map_err(|e| TransactionDownloadVerifyError::StateError(e))?
            .call(zs::Request::Transaction(txid.mined_id()))
            .await
        {
            Ok(zs::Response::Transaction(None)) => Ok(()),
            Ok(zs::Response::Transaction(Some(_))) => Err(TransactionDownloadVerifyError::InState),
            Ok(_) => unreachable!("wrong response"),
            Err(e) => Err(TransactionDownloadVerifyError::StateError(e)),
        }?;

        Ok(())
    }
/// Check if transaction is already in the state.
Check if transaction is already in the state.
Check if transaction is already in the state .
async fn transaction_in_state(
        state: &mut ZS,
        txid: UnminedTxId,
    ) -> Result<(), TransactionDownloadVerifyError> {
        // Check if the transaction is already in the state.
        match state
            .ready()
            .await
            .map_err(|e| TransactionDownloadVerifyError::StateError(e))?
            .call(zs::Request::Transaction(txid.mined_id()))
            .await
        {
            Ok(zs::Response::Transaction(None)) => Ok(()),
            Ok(zs::Response::Transaction(Some(_))) => Err(TransactionDownloadVerifyError::InState),
            Ok(_) => unreachable!("wrong response"),
            Err(e) => Err(TransactionDownloadVerifyError::StateError(e)),
        }?;
        Ok(())
    }
async fn transaction_in_state ( state : & mut ZS , txid : UnminedTxId , ) -> Result < ( ) , TransactionDownloadVerifyError > { // Check if the transaction is already in the state. match state . ready ( ) . await . map_err ( | e | TransactionDownloadVerifyError :: StateError ( e ) ) ? . call ( zs :: Request :: Transaction ( txid . mined_id ( ) ) ) . await { Ok ( zs :: Response :: Transaction ( None ) ) => Ok ( ( ) ) , Ok ( zs :: Response :: Transaction ( Some ( _ ) ) ) => Err ( TransactionDownloadVerifyError :: InState ) , Ok ( _ ) => unreachable ! ( " " ) , Err ( e ) => Err ( TransactionDownloadVerifyError :: StateError ( e ) ) , } ? ; Ok ( ( ) ) }
Check if transaction is already in the state.
Check if transaction is already in the state .
state
&mut ZS
txid
UnminedTxId