Skip to content

Commit

Permalink
Do not pollute global base path with export genesis/wasm (#2487)
Browse files Browse the repository at this point in the history
Otherwise the user may runs into weird errors if there is already a db.
  • Loading branch information
bkchr authored Nov 24, 2023
1 parent 63f1210 commit 5e27342
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cumulus/client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ impl sc_cli::CliConfiguration for ExportGenesisStateCommand {
fn shared_params(&self) -> &sc_cli::SharedParams {
&self.shared_params
}

fn base_path(&self) -> sc_cli::Result<Option<BasePath>> {
// As we are just exporting the genesis wasm a tmp database is enough.
//
// As otherwise we may "pollute" the global base path.
Ok(Some(BasePath::new_temp_dir()?))
}
}

/// Command for exporting the genesis wasm file.
Expand Down Expand Up @@ -266,6 +273,13 @@ impl sc_cli::CliConfiguration for ExportGenesisWasmCommand {
fn shared_params(&self) -> &sc_cli::SharedParams {
&self.shared_params
}

fn base_path(&self) -> sc_cli::Result<Option<BasePath>> {
// As we are just exporting the genesis wasm a tmp database is enough.
//
// As otherwise we may "pollute" the global base path.
Ok(Some(BasePath::new_temp_dir()?))
}
}

fn validate_relay_chain_url(arg: &str) -> Result<Url, String> {
Expand Down

0 comments on commit 5e27342

Please sign in to comment.