From 40aca5ba65f1181e8496eb91615d73c0d3c01502 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:50:00 +0200 Subject: [PATCH] tx: Remove `wait_for_in_block` helper method (#1237) Signed-off-by: Alexandru Vasile --- subxt/src/tx/tx_progress.rs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/subxt/src/tx/tx_progress.rs b/subxt/src/tx/tx_progress.rs index 65164b1ffe..b949de2be4 100644 --- a/subxt/src/tx/tx_progress.rs +++ b/subxt/src/tx/tx_progress.rs @@ -71,37 +71,6 @@ where StreamExt::next(self).await } - /// Wait for the transaction to be in a block (but not necessarily finalized), and return - /// an [`TxInBlock`] instance when this happens, or an error if there was a problem - /// waiting for this to happen. - /// - /// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the - /// transaction progresses, use [`TxProgress::next()`] instead. - /// - /// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some - /// probability that the transaction will not make it into a block but there is no guarantee - /// that this is true. In those cases the stream is closed however, so you currently have no way to find - /// out if they finally made it into a block or not. - pub async fn wait_for_in_block(mut self) -> Result, Error> { - while let Some(status) = self.next().await { - match status? { - // Finalized or otherwise in a block! Return. - TxStatus::InBestBlock(s) | TxStatus::InFinalizedBlock(s) => return Ok(s), - // Error scenarios; return the error. - TxStatus::Error { message } => return Err(TransactionError::Error(message).into()), - TxStatus::Invalid { message } => { - return Err(TransactionError::Invalid(message).into()) - } - TxStatus::Dropped { message } => { - return Err(TransactionError::Dropped(message).into()) - } - // Ignore anything else and wait for next status event: - _ => continue, - } - } - Err(RpcError::SubscriptionDropped.into()) - } - /// Wait for the transaction to be finalized, and return a [`TxInBlock`] /// instance when it is, or an error if there was a problem waiting for finalization. ///