async fn wait_for_persistence(
stream: &mut SubscriptionStream<BlockNumHash>,
target: u64,
last_persisted: &mut u64,
timeout: Duration,
) -> Result<()>Expand description
Waits until the persistence subscription reports that target has been persisted.
Consumes subscription events until last_persisted >= target, or returns an error if:
- the subscription stream ends unexpectedly, or
timeoutelapses beforetargetis observed.