Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iota): properly set iota keytool command --alias option #4767

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/iota/src/keytool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,11 @@ impl KeyToolCommand {
} => match IotaKeyPair::decode(&input_string) {
Ok(ikp) => {
info!("Importing Bech32 encoded private key to keystore");
let key = Key::from(&ikp);
let mut key = Key::from(&ikp);

keystore.add_key(alias, ikp)?;
key.alias = Some(keystore.get_alias_by_address(&key.iota_address)?);

CommandOutput::Import(key)
}
Err(_) => {
Expand All @@ -617,7 +620,10 @@ impl KeyToolCommand {
};

let ikp = keystore.get_key(&iota_address)?;
let key = Key::from(ikp);
let mut key = Key::from(ikp);

key.alias = Some(keystore.get_alias_by_address(&key.iota_address)?);

CommandOutput::Import(key)
}
},
Expand Down
Loading