Skip to content

Commit

Permalink
Strips new line from seed
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio committed Sep 10, 2024
1 parent 43b2e77 commit 0916365
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ async fn get_keys(key_store_path: &Path, password: SecretString) -> Keypair {
}

let content = fs::read_to_string(entry.path()).expect("Unable to read file");
let strip_content = content.strip_suffix("\r\n").or(content.strip_suffix("\n")).unwrap_or(&*content).to_string();
let secret = format!(
"{}///{}",
content.replace("\"", ""),
strip_content.replace("\"", ""),
password.expose_secret()
);

let uri = SecretUri::from_str(&secret).expect("valid URI");
let keypair_tx = Keypair::from_uri(&uri).expect("valid keypair");

Expand Down
Empty file.

0 comments on commit 0916365

Please sign in to comment.