Skip to content
Snippets Groups Projects
Commit 30292fa1 authored by Éloïs's avatar Éloïs
Browse files

feat(cli): use paritydb

parent 234552ab
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,10 @@ impl SubstrateCli for Cli {
/// Parse and run command line arguments
pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();
let mut cli = Cli::from_args();
// Force some cli options
force_cli_options(&mut cli);
match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
......@@ -286,3 +289,24 @@ pub fn run() -> sc_cli::Result<()> {
}
}
}
fn force_cli_options(cli: &mut Cli) {
match cli.subcommand {
Some(Subcommand::CheckBlock(ref mut cmd)) => {
cmd.import_params.database_params.database = Some(sc_cli::Database::ParityDb);
}
Some(Subcommand::ExportBlocks(ref mut cmd)) => {
cmd.database_params.database = Some(sc_cli::Database::ParityDb);
}
Some(Subcommand::ImportBlocks(ref mut cmd)) => {
cmd.import_params.database_params.database = Some(sc_cli::Database::ParityDb);
}
Some(Subcommand::PurgeChain(ref mut cmd)) => {
cmd.database_params.database = Some(sc_cli::Database::ParityDb);
}
None => {
cli.run.import_params.database_params.database = Some(sc_cli::Database::ParityDb);
}
_ => {}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment