Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nonast committed Mar 5, 2023
1 parent 92001c3 commit 40e9732
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion ol/genesis-tools/src/fork_genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ pub fn make_recovery_genesis_from_vec_legacy_recovery(
/// save the genesis blob
pub fn save_genesis(gen_tx: &Transaction, output_path: PathBuf) -> Result<(), Error> {
let file_path = output_path.join("genesis").with_extension("blob");
println!("Saving genesis to: {:?}", &file_path);
let mut file = File::create(file_path)?;
let bytes = bcs::to_bytes(&gen_tx)?;
file.write_all(&bytes)?;
Expand Down
13 changes: 2 additions & 11 deletions ol/genesis-tools/src/wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Default for GenesisWizard {
github_username: "".to_string(),
github_token: "".to_string(),
data_path,
epoch: None, // What should this default value be?
epoch: None,
}
}
}
Expand Down Expand Up @@ -124,7 +124,6 @@ impl GenesisWizard {
.interact()? {
self.download_snapshot(&app_config)?
} else {
// TODO(Nima): Instead of using a test, let's ask the user for the patht to a snapshot
let input = Input::<String>::new()
.with_prompt("Enter the (absolute) path to the snapshot state.manifest file")
.interact_text()?;
Expand All @@ -142,7 +141,6 @@ impl GenesisWizard {
false,
)?;


// reset the safety rules
reset_safety_data(&self.data_path, &app_config.format_oper_namespace());

Expand All @@ -152,12 +150,9 @@ impl GenesisWizard {
// remove "owner" key from key_store.json
self.maybe_remove_money_keys(&app_config);


// verify genesis
self.check_keys_and_genesis(&app_config)?;



for _ in (0..10)
.progress_with_style(OLProgress::fun())
.with_message("Initializing 0L")
Expand All @@ -179,7 +174,7 @@ impl GenesisWizard {
.interact_text()
{
Ok(s) => {
// save the token to the file, and create the folders if necessary
// creates the folders if necessary (this check is called before host init)
std::fs::create_dir_all(&self.data_path)?;
std::fs::write(&gh_token_path, s)?;
}
Expand Down Expand Up @@ -375,7 +370,6 @@ impl GenesisWizard {
}

fn check_keys_and_genesis(&self, app_cfg: &AppCfg) -> anyhow::Result<String> {
println!("Checking keys and genesis. Key name: {}", app_cfg.format_owner_namespace());
let val = Key::validator_backend(
app_cfg.format_owner_namespace().clone(),
self.data_path.clone(),
Expand Down Expand Up @@ -406,9 +400,6 @@ impl GenesisWizard {

pb.enable_steady_tick(Duration::from_millis(100));


//TODO(Nima): Check if we already have the snapshot downloaded.

// All we are doing is download the snapshot from github.
let backup = Backup::new(self.epoch, app_cfg);

Expand Down

0 comments on commit 40e9732

Please sign in to comment.