mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-03-31 08:13:48 +00:00
Unify manual cluster control surface
This commit is contained in:
parent
4b44a962d6
commit
fb4c58cc48
@ -1,15 +1,7 @@
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::scenario::{Application, DynError, NodeControlHandle, StartNodeOptions, StartedNode};
|
||||
use crate::scenario::{Application, ClusterWaitHandle, NodeControlHandle};
|
||||
|
||||
/// Interface for imperative, deployer-backed manual clusters.
|
||||
#[async_trait]
|
||||
pub trait ManualClusterHandle<E: Application>: NodeControlHandle<E> {
|
||||
async fn start_node_with(
|
||||
&self,
|
||||
name: &str,
|
||||
options: StartNodeOptions<E>,
|
||||
) -> Result<StartedNode<E>, DynError>;
|
||||
|
||||
async fn wait_network_ready(&self) -> Result<(), DynError>;
|
||||
}
|
||||
pub trait ManualClusterHandle<E: Application>: NodeControlHandle<E> + ClusterWaitHandle<E> {}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
use testing_framework_core::{
|
||||
manual::ManualClusterHandle,
|
||||
scenario::{
|
||||
DynError, ExternalNodeSource, NodeClients, NodeControlHandle, ReadinessError,
|
||||
StartNodeOptions, StartedNode,
|
||||
ClusterWaitHandle, DynError, ExternalNodeSource, NodeClients, NodeControlHandle,
|
||||
ReadinessError, StartNodeOptions, StartedNode,
|
||||
},
|
||||
};
|
||||
use thiserror::Error;
|
||||
@ -157,19 +157,11 @@ impl<E: LocalDeployerEnv> NodeControlHandle<E> for ManualCluster<E> {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl<E: LocalDeployerEnv> ManualClusterHandle<E> for ManualCluster<E> {
|
||||
async fn start_node_with(
|
||||
&self,
|
||||
name: &str,
|
||||
options: StartNodeOptions<E>,
|
||||
) -> Result<StartedNode<E>, DynError> {
|
||||
self.nodes
|
||||
.start_node_with(name, options)
|
||||
.await
|
||||
.map_err(|err| err.into())
|
||||
}
|
||||
|
||||
impl<E: LocalDeployerEnv> ClusterWaitHandle<E> for ManualCluster<E> {
|
||||
async fn wait_network_ready(&self) -> Result<(), DynError> {
|
||||
self.wait_network_ready().await.map_err(|err| err.into())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl<E: LocalDeployerEnv> ManualClusterHandle<E> for ManualCluster<E> {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user