Skip to content

Commit

Permalink
Merge pull request #523 from subspace/cirrus-test-upgrade
Browse files Browse the repository at this point in the history
Upgrade cirrus test framework
  • Loading branch information
liuchengxu authored Jun 1, 2022
2 parents 005c2a2 + 856c398 commit a5374db
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 473 deletions.
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion crates/subspace-node/src/bin/subspace-node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use frame_benchmarking_cli::BenchmarkCmd;
use futures::future::TryFutureExt;
use futures::StreamExt;
use sc_cli::{ChainSpec, CliConfiguration, Database, DatabaseParams, SubstrateCli};
use sc_executor::NativeExecutionDispatch;
use sc_service::PartialComponents;
use sc_subspace_chain_specs::ExecutionChainSpec;
use sp_core::crypto::Ss58AddressFormat;
Expand All @@ -29,6 +30,24 @@ use subspace_node::{Cli, ExecutorDispatch, SecondaryChainCli, Subcommand};
use subspace_runtime::{Block, RuntimeApi};
use subspace_service::SubspaceConfiguration;

/// Secondary executor instance.
pub struct SecondaryExecutorDispatch;

impl NativeExecutionDispatch for SecondaryExecutorDispatch {
#[cfg(feature = "runtime-benchmarks")]
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
#[cfg(not(feature = "runtime-benchmarks"))]
type ExtendHostFunctions = ();

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
cirrus_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
cirrus_runtime::native_version()
}
}

/// Subspace node error.
#[derive(thiserror::Error, Debug)]
pub enum Error {
Expand Down Expand Up @@ -385,7 +404,15 @@ fn main() -> Result<(), Error> {
))
})?;

let secondary_chain_node_fut = cirrus_node::service::new_full(
let secondary_chain_node_fut = cirrus_node::service::new_full::<
_,
_,
_,
_,
_,
cirrus_runtime::RuntimeApi,
SecondaryExecutorDispatch,
>(
secondary_chain_config,
primary_chain_node.client.clone(),
primary_chain_node.network.clone(),
Expand Down
Loading

0 comments on commit a5374db

Please sign in to comment.