From 20fdcf78985c4c2cc50e56152737d867d24fb3de Mon Sep 17 00:00:00 2001
From: nanocryk <6422796+nanocryk@users.noreply.github.com>
Date: Tue, 3 Sep 2024 12:21:45 +0200
Subject: [PATCH] spawner mock
---
Cargo.lock | 2 +
client/service-container-chain/Cargo.toml | 4 +
.../src/data_preservers.rs | 270 +++++++++++++++++-
client/service-container-chain/src/spawner.rs | 38 ++-
4 files changed, 305 insertions(+), 9 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 61d3f383c..b0e8aae28 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17521,6 +17521,7 @@ dependencies = [
"node-common",
"pallet-author-noting-runtime-api",
"pallet-data-preservers",
+ "polkadot-overseer",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
@@ -17554,6 +17555,7 @@ dependencies = [
"substrate-prometheus-endpoint",
"tc-consensus",
"tokio",
+ "tokio-stream",
"tokio-util",
]
diff --git a/client/service-container-chain/Cargo.toml b/client/service-container-chain/Cargo.toml
index eba3de681..181b036aa 100644
--- a/client/service-container-chain/Cargo.toml
+++ b/client/service-container-chain/Cargo.toml
@@ -82,6 +82,10 @@ cumulus-relay-chain-interface = { workspace = true }
nimbus-consensus = { workspace = true }
nimbus-primitives = { workspace = true }
+[dev-dependencies]
+polkadot-overseer = { workspace = true }
+tokio-stream = { workspace = true }
+
[build-dependencies]
substrate-build-script-utils = { workspace = true }
diff --git a/client/service-container-chain/src/data_preservers.rs b/client/service-container-chain/src/data_preservers.rs
index d69a53fc5..36d9cef0e 100644
--- a/client/service-container-chain/src/data_preservers.rs
+++ b/client/service-container-chain/src/data_preservers.rs
@@ -15,7 +15,7 @@
// along with Tanssi. If not, see
use {
- crate::spawner::{ContainerChainSpawner, TSelectSyncMode},
+ crate::spawner::{ContainerChainSpawner, Spawner, TSelectSyncMode},
dc_orchestrator_chain_interface::{
DataPreserverAssignment, OrchestratorChainInterface, OrchestratorChainResult,
},
@@ -32,14 +32,11 @@ async fn try_fut(fut: impl Future