Companion PR for 'Make choosing an executor an explicit part of service construction' (#9525) (#3615)

* Companion PR

* Update a few files

* Run cargo fmt

* Do better at renaming things

* More renamings

* More fixes

* oops

* Fix simnet problems

* fix compilation

* Update substrate

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Ashley
2021-08-18 15:26:30 +02:00
committed by GitHub
parent e3eb5fda68
commit d88dec65fb
9 changed files with 277 additions and 237 deletions
+12 -6
View File
@@ -376,23 +376,29 @@ pub fn run() -> Result<()> {
#[cfg(feature = "kusama-native")]
if chain_spec.is_kusama() {
return Ok(runner.sync_run(|config| {
cmd.run::<service::kusama_runtime::Block, service::KusamaExecutor>(config)
.map_err(|e| Error::SubstrateCli(e))
cmd.run::<service::kusama_runtime::Block, service::KusamaExecutorDispatch>(
config,
)
.map_err(|e| Error::SubstrateCli(e))
})?)
}
#[cfg(feature = "westend-native")]
if chain_spec.is_westend() {
return Ok(runner.sync_run(|config| {
cmd.run::<service::westend_runtime::Block, service::WestendExecutor>(config)
.map_err(|e| Error::SubstrateCli(e))
cmd.run::<service::westend_runtime::Block, service::WestendExecutorDispatch>(
config,
)
.map_err(|e| Error::SubstrateCli(e))
})?)
}
// else we assume it is polkadot.
Ok(runner.sync_run(|config| {
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
.map_err(|e| Error::SubstrateCli(e))
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(
config,
)
.map_err(|e| Error::SubstrateCli(e))
})?)
},
Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?),