Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add db params for export-state CLI command #10830

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/cli/src/commands/export_blocks_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl ExportBlocksCmd {
C: BlockBackend<B> + UsageProvider<B> + 'static,
<<B::Header as HeaderT>::Number as FromStr>::Err: Debug,
{
if let DatabaseSource::RocksDb { ref path, .. } = database_config {
if let Some(path) = database_config.path() {
info!("DB path: {}", path.display());
}

Expand Down
10 changes: 9 additions & 1 deletion client/cli/src/commands/export_state_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use crate::{
error,
params::{BlockNumberOrHash, PruningParams, SharedParams},
params::{BlockNumberOrHash, DatabaseParams, PruningParams, SharedParams},
CliConfiguration,
};
use clap::Parser;
Expand All @@ -42,6 +42,10 @@ pub struct ExportStateCmd {
#[allow(missing_docs)]
#[clap(flatten)]
pub pruning_params: PruningParams,

#[allow(missing_docs)]
#[clap(flatten)]
pub database_params: DatabaseParams,
}

impl ExportStateCmd {
Expand Down Expand Up @@ -81,4 +85,8 @@ impl CliConfiguration for ExportStateCmd {
fn pruning_params(&self) -> Option<&PruningParams> {
Some(&self.pruning_params)
}

fn database_params(&self) -> Option<&DatabaseParams> {
Some(&self.database_params)
}
}