Skip to content

Commit

Permalink
Fix chain spec (#1243)
Browse files Browse the repository at this point in the history
  • Loading branch information
hqwangningbo authored May 10, 2024
1 parent 50205ab commit f0772ba
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 610 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ sp-consensus-slots = { version = "0.32.0", default-featu
sp-core = { version = "28.0.0", default-features = false }
sp-debug-derive = { version = "14.0.0", default-features = false }
sp-externalities = { version = "0.25.0", default-features = false }
sp-genesis-builder = { version = "0.7.0", default-features = false }
sp-inherents = { version = "26.0.0", default-features = false }
sp-io = { version = "30.0.0", default-features = false }
sp-keyring = { version = "31.0.0", default-features = false }
Expand Down
21 changes: 6 additions & 15 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,7 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
Box::new(service::chain_spec::bifrost_kusama::chainspec_config()),
#[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))]
"bifrost-local" | "bifrost-kusama-local" =>
Box::new(service::chain_spec::bifrost_kusama::local_testnet_config()?),
#[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))]
"bifrost-kusama-rococo" =>
Box::new(service::chain_spec::bifrost_kusama::rococo_testnet_config()?),
#[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))]
"bifrost-kusama-rococo-local" =>
Box::new(service::chain_spec::bifrost_kusama::rococo_local_config()?),

Box::new(service::chain_spec::bifrost_kusama::local_testnet_config()),
#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
"bifrost-polkadot" =>
Box::new(service::chain_spec::bifrost_polkadot::ChainSpec::from_json_bytes(
Expand All @@ -77,11 +70,9 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
"bifrost-polkadot-genesis" => Box::new(service::chain_spec::bifrost_polkadot::chainspec_config()),
#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
"bifrost-polkadot-local" =>
Box::new(service::chain_spec::bifrost_polkadot::local_testnet_config()?),
#[cfg(feature = "with-bifrost-kusama-runtime")]
"dev" => Box::new(service::chain_spec::bifrost_kusama::development_config()?),
#[cfg(feature = "with-bifrost-polkadot-runtime")]
"bifrost-polkadot-dev" => Box::new(service::chain_spec::bifrost_polkadot::development_config()?),
Box::new(service::chain_spec::bifrost_polkadot::local_testnet_config()),
#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
"bifrost-paseo" => Box::new(service::chain_spec::bifrost_polkadot::paseo_config()),
path => {
let path = std::path::PathBuf::from(path);
if path.to_str().map(|s| s.contains("bifrost-polkadot")) == Some(true) {
Expand Down Expand Up @@ -194,7 +185,7 @@ macro_rules! with_runtime_or_err {
if $chain_spec.is_bifrost_kusama() || $chain_spec.is_dev() {
#[cfg(any(feature = "with-bifrost-kusama-runtime",feature = "with-bifrost-runtime"))]
#[allow(unused_imports)]
use service::collator_kusama::{bifrost_kusama_runtime::{Block, RuntimeApi},BifrostExecutor as Executor,start_node,new_partial};
use service::collator_kusama::{bifrost_kusama_runtime::{Block, RuntimeApi}, start_node,new_partial};

#[cfg(any(feature = "with-bifrost-kusama-runtime",feature = "with-bifrost-runtime"))]
$( $code )*
Expand All @@ -204,7 +195,7 @@ macro_rules! with_runtime_or_err {
} else if $chain_spec.is_bifrost_polkadot() {
#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
#[allow(unused_imports)]
use service::collator_polkadot::{bifrost_polkadot_runtime::{Block, RuntimeApi},BifrostPolkadotExecutor as Executor,start_node,new_partial};
use service::collator_polkadot::{bifrost_polkadot_runtime::{Block, RuntimeApi}, start_node,new_partial};

#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
$( $code )*
Expand Down
Loading

0 comments on commit f0772ba

Please sign in to comment.