mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-02-17 11:43:12 +00:00
39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
|
|
use async_trait::async_trait;
|
||
|
|
|
||
|
|
use crate::{
|
||
|
|
nodes::ApiClient,
|
||
|
|
scenario::{DynError, StartNodeOptions, StartedNode},
|
||
|
|
};
|
||
|
|
|
||
|
|
/// Deployer-agnostic control surface for runtime node operations.
|
||
|
|
#[async_trait]
|
||
|
|
pub trait NodeControlHandle: Send + Sync {
|
||
|
|
async fn restart_node(&self, _name: &str) -> Result<(), DynError> {
|
||
|
|
Err("restart_node not supported by this deployer".into())
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn start_node(&self, _name: &str) -> Result<StartedNode, DynError> {
|
||
|
|
Err("start_node not supported by this deployer".into())
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn start_node_with(
|
||
|
|
&self,
|
||
|
|
_name: &str,
|
||
|
|
_options: StartNodeOptions,
|
||
|
|
) -> Result<StartedNode, DynError> {
|
||
|
|
Err("start_node_with not supported by this deployer".into())
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn stop_node(&self, _name: &str) -> Result<(), DynError> {
|
||
|
|
Err("stop_node not supported by this deployer".into())
|
||
|
|
}
|
||
|
|
|
||
|
|
fn node_client(&self, _name: &str) -> Option<ApiClient> {
|
||
|
|
None
|
||
|
|
}
|
||
|
|
|
||
|
|
fn node_pid(&self, _name: &str) -> Option<u32> {
|
||
|
|
None
|
||
|
|
}
|
||
|
|
}
|