mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-04-02 01:03:14 +00:00
29 lines
742 B
Rust
29 lines
742 B
Rust
use testing_framework_core::scenario::{
|
|
Application, FeedHandle, FeedRuntime, NodeClients, spawn_feed,
|
|
};
|
|
use tracing::{debug, info};
|
|
|
|
use crate::deployer::K8sRunnerError;
|
|
|
|
pub async fn spawn_block_feed_with<E: Application>(
|
|
node_clients: &NodeClients<E>,
|
|
) -> Result<
|
|
(
|
|
<<E as Application>::FeedRuntime as FeedRuntime>::Feed,
|
|
FeedHandle,
|
|
),
|
|
K8sRunnerError,
|
|
> {
|
|
let node_count = node_clients.len();
|
|
debug!(nodes = node_count, "starting k8s block feed");
|
|
|
|
if node_count == 0 {
|
|
return Err(K8sRunnerError::BlockFeedMissing);
|
|
}
|
|
|
|
info!("starting block feed");
|
|
spawn_feed::<E>(node_clients.clone())
|
|
.await
|
|
.map_err(|source| K8sRunnerError::BlockFeed { source })
|
|
}
|