Skip to content

Commit 40aca5b

Browse files
authored
tx: Remove wait_for_in_block helper method (paritytech#1237)
Signed-off-by: Alexandru Vasile <[email protected]>
1 parent 1b88ebf commit 40aca5b

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

subxt/src/tx/tx_progress.rs

-31
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,6 @@ where
7171
StreamExt::next(self).await
7272
}
7373

74-
/// Wait for the transaction to be in a block (but not necessarily finalized), and return
75-
/// an [`TxInBlock`] instance when this happens, or an error if there was a problem
76-
/// waiting for this to happen.
77-
///
78-
/// **Note:** consumes `self`. If you'd like to perform multiple actions as the state of the
79-
/// transaction progresses, use [`TxProgress::next()`] instead.
80-
///
81-
/// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some
82-
/// probability that the transaction will not make it into a block but there is no guarantee
83-
/// that this is true. In those cases the stream is closed however, so you currently have no way to find
84-
/// out if they finally made it into a block or not.
85-
pub async fn wait_for_in_block(mut self) -> Result<TxInBlock<T, C>, Error> {
86-
while let Some(status) = self.next().await {
87-
match status? {
88-
// Finalized or otherwise in a block! Return.
89-
TxStatus::InBestBlock(s) | TxStatus::InFinalizedBlock(s) => return Ok(s),
90-
// Error scenarios; return the error.
91-
TxStatus::Error { message } => return Err(TransactionError::Error(message).into()),
92-
TxStatus::Invalid { message } => {
93-
return Err(TransactionError::Invalid(message).into())
94-
}
95-
TxStatus::Dropped { message } => {
96-
return Err(TransactionError::Dropped(message).into())
97-
}
98-
// Ignore anything else and wait for next status event:
99-
_ => continue,
100-
}
101-
}
102-
Err(RpcError::SubscriptionDropped.into())
103-
}
104-
10574
/// Wait for the transaction to be finalized, and return a [`TxInBlock`]
10675
/// instance when it is, or an error if there was a problem waiting for finalization.
10776
///

0 commit comments

Comments
 (0)