mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-04-01 00:33:40 +00:00
Reduce runtime wait surface
This commit is contained in:
parent
fb4c58cc48
commit
365526d236
@ -121,22 +121,12 @@ impl<E: Application> RunContext<E> {
|
||||
self.node_control.clone()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn cluster_wait(&self) -> Option<Arc<dyn ClusterWaitHandle<E>>> {
|
||||
self.cluster_wait.clone()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub const fn controls_nodes(&self) -> bool {
|
||||
self.node_control.is_some()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub const fn can_wait_network_ready(&self) -> bool {
|
||||
self.cluster_wait.is_some()
|
||||
}
|
||||
|
||||
pub async fn wait_network_ready(&self) -> Result<(), DynError> {
|
||||
pub(crate) async fn wait_network_ready(&self) -> Result<(), DynError> {
|
||||
self.require_cluster_wait()?.wait_network_ready().await
|
||||
}
|
||||
|
||||
@ -146,7 +136,9 @@ impl<E: Application> RunContext<E> {
|
||||
}
|
||||
|
||||
fn require_cluster_wait(&self) -> Result<Arc<dyn ClusterWaitHandle<E>>, DynError> {
|
||||
self.cluster_wait()
|
||||
self.cluster_wait
|
||||
.as_ref()
|
||||
.map(Arc::clone)
|
||||
.ok_or_else(|| RunContextCapabilityError::MissingClusterWait.into())
|
||||
}
|
||||
}
|
||||
@ -192,10 +184,6 @@ impl<E: Application> RunHandle<E> {
|
||||
pub fn context(&self) -> &RunContext<E> {
|
||||
&self.run_context
|
||||
}
|
||||
|
||||
pub async fn wait_network_ready(&self) -> Result<(), DynError> {
|
||||
self.run_context.wait_network_ready().await
|
||||
}
|
||||
}
|
||||
|
||||
/// Derived metrics about the current run timing.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user