Skip to content

Commit

Permalink
add helper in init to reset safety data
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Jun 18, 2022
1 parent 8c8d9f3 commit 222b963
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ol/cli/src/commands/init_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ pub struct InitCmd {
/// Path to source code, for devs
#[options(help = "Path to source code, for devs")]
source_path: Option<PathBuf>,

/// reset the safety rules state in key_store.json
#[options(help = "reset the safety data in key_store.json to null")]
reset_safety: bool,
}

impl Runnable for InitCmd {
Expand Down Expand Up @@ -250,6 +254,14 @@ impl Runnable for InitCmd {
return;
}

if self.reset_safety {
diem_genesis_tool::key::reset_safety_data(
&app_cfg.workspace.node_home,
&app_cfg.format_owner_namespace()
);
exit(0)
}

/////////// Everything below requires mnemonic ////////
let (authkey, account, wallet) = wallet::get_account_from_prompt();

Expand Down
1 change: 1 addition & 0 deletions ol/cli/src/mgmt/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub fn fast_forward_db(
&backup.home_path,
&backup.node_namespace
);
println!("SUCCESS");

Ok(())
}
Expand Down

0 comments on commit 222b963

Please sign in to comment.