Skip to content

Commit a5374db

Browse files
authored
Merge pull request #523 from subspace/cirrus-test-upgrade
Upgrade cirrus test framework
2 parents 005c2a2 + 856c398 commit a5374db

File tree

8 files changed

+476
-473
lines changed

8 files changed

+476
-473
lines changed

Cargo.lock

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/subspace-node/src/bin/subspace-node.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use frame_benchmarking_cli::BenchmarkCmd;
2121
use futures::future::TryFutureExt;
2222
use futures::StreamExt;
2323
use sc_cli::{ChainSpec, CliConfiguration, Database, DatabaseParams, SubstrateCli};
24+
use sc_executor::NativeExecutionDispatch;
2425
use sc_service::PartialComponents;
2526
use sc_subspace_chain_specs::ExecutionChainSpec;
2627
use sp_core::crypto::Ss58AddressFormat;
@@ -29,6 +30,24 @@ use subspace_node::{Cli, ExecutorDispatch, SecondaryChainCli, Subcommand};
2930
use subspace_runtime::{Block, RuntimeApi};
3031
use subspace_service::SubspaceConfiguration;
3132

33+
/// Secondary executor instance.
34+
pub struct SecondaryExecutorDispatch;
35+
36+
impl NativeExecutionDispatch for SecondaryExecutorDispatch {
37+
#[cfg(feature = "runtime-benchmarks")]
38+
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
39+
#[cfg(not(feature = "runtime-benchmarks"))]
40+
type ExtendHostFunctions = ();
41+
42+
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
43+
cirrus_runtime::api::dispatch(method, data)
44+
}
45+
46+
fn native_version() -> sc_executor::NativeVersion {
47+
cirrus_runtime::native_version()
48+
}
49+
}
50+
3251
/// Subspace node error.
3352
#[derive(thiserror::Error, Debug)]
3453
pub enum Error {
@@ -385,7 +404,15 @@ fn main() -> Result<(), Error> {
385404
))
386405
})?;
387406

388-
let secondary_chain_node_fut = cirrus_node::service::new_full(
407+
let secondary_chain_node_fut = cirrus_node::service::new_full::<
408+
_,
409+
_,
410+
_,
411+
_,
412+
_,
413+
cirrus_runtime::RuntimeApi,
414+
SecondaryExecutorDispatch,
415+
>(
389416
secondary_chain_config,
390417
primary_chain_node.client.clone(),
391418
primary_chain_node.network.clone(),

0 commit comments

Comments
 (0)