mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-03 05:43:09 +00:00
20 lines
513 B
Rust
20 lines
513 B
Rust
use async_trait::async_trait;
|
|
use testing_framework_core::scenario::{DynError, RunContext, Workload};
|
|
|
|
struct RestartWorkload;
|
|
|
|
#[async_trait]
|
|
impl Workload for RestartWorkload {
|
|
fn name(&self) -> &str {
|
|
"restart_workload"
|
|
}
|
|
|
|
async fn start(&self, ctx: &RunContext) -> Result<(), DynError> {
|
|
if let Some(control) = ctx.node_control() {
|
|
// Restart the first validator (index 0) if supported.
|
|
control.restart_validator(0).await?;
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|