mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-24 12:27:59 +00:00
Upgrade to substrate 2.0.0 (#173)
* Upgrade to substrate 2.0.0 * WIP implement Subcommand manually (see https://github.com/paritytech/substrate/pull/6894#issuecomment-676060197) * Add pallet-staking/std to the std feature * Sort out the subcommand impl * Sort out the module index (ty @ascjones) Sort out the RefCount type (ty @dvc94ch) Random tweaks to make test-node more similar to the vanilla node-template * obey the fmt * cleanup * more cleanup
This commit is contained in:
@@ -101,7 +101,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
|
||||
// Properties
|
||||
None,
|
||||
// Extensions
|
||||
None,
|
||||
Default::default(),
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -15,11 +15,20 @@
|
||||
// along with substrate-subxt. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use sc_cli::{
|
||||
BuildSpecCmd,
|
||||
PurgeChainCmd,
|
||||
RunCmd,
|
||||
Subcommand,
|
||||
};
|
||||
use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub enum Subcommand {
|
||||
/// Build a spec.json file, outputs to stdout.
|
||||
BuildSpec(BuildSpecCmd),
|
||||
/// Remove the whole chain data.
|
||||
PurgeChain(PurgeChainCmd),
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct Cli {
|
||||
#[structopt(subcommand)]
|
||||
|
||||
+11
-14
@@ -16,7 +16,10 @@
|
||||
|
||||
use crate::{
|
||||
chain_spec,
|
||||
cli::Cli,
|
||||
cli::{
|
||||
Cli,
|
||||
Subcommand,
|
||||
},
|
||||
service,
|
||||
};
|
||||
use sc_cli::{
|
||||
@@ -25,7 +28,6 @@ use sc_cli::{
|
||||
RuntimeVersion,
|
||||
SubstrateCli,
|
||||
};
|
||||
use sc_service::PartialComponents;
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
fn impl_name() -> String {
|
||||
@@ -74,18 +76,13 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
let cli = Cli::from_args();
|
||||
|
||||
match &cli.subcommand {
|
||||
Some(subcommand) => {
|
||||
let runner = cli.create_runner(subcommand)?;
|
||||
runner.run_subcommand(subcommand, |config| {
|
||||
let PartialComponents {
|
||||
client,
|
||||
backend,
|
||||
task_manager,
|
||||
import_queue,
|
||||
..
|
||||
} = service::new_partial(&config)?;
|
||||
Ok((client, backend, import_queue, task_manager))
|
||||
})
|
||||
Some(Subcommand::BuildSpec(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
|
||||
}
|
||||
Some(Subcommand::PurgeChain(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|config| cmd.run(config.database))
|
||||
}
|
||||
None => {
|
||||
let runner = cli.create_runner(&cli.run)?;
|
||||
|
||||
Reference in New Issue
Block a user