Do not pollute global base path with export genesis/wasm (#2487)

Otherwise the user may runs into weird errors if there is already a db.
This commit is contained in:
Bastian Köcher
2023-11-25 00:22:52 +01:00
committed by GitHub
parent 63f1210d08
commit 5e27342198
+14
View File
@@ -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.
@@ -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> {