From 4d626583bebacc81c2b202383312ae43708330ae Mon Sep 17 00:00:00 2001 From: Mateusz Kaczanowski Date: Mon, 16 Oct 2023 23:15:11 +0200 Subject: [PATCH 1/3] fix importing softsign secp256k1 key type --- src/commands/softsign/import.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commands/softsign/import.rs b/src/commands/softsign/import.rs index 63a8ac37..b945dbe3 100644 --- a/src/commands/softsign/import.rs +++ b/src/commands/softsign/import.rs @@ -61,6 +61,12 @@ impl Runnable for ImportCommand { process::exit(1); }); } + PrivateKey::Secp256k1(sk) => { + key_utils::write_base64_secret(output_path, &sk.to_bytes()).unwrap_or_else(|e| { + status_err!("{}", e); + process::exit(1); + }); + } _ => unreachable!("unsupported priv_validator.json algorithm"), } From 652b8960612d40a3bfb38d40b8ada52222d9a342 Mon Sep 17 00:00:00 2001 From: Mateusz Kaczanowski Date: Mon, 16 Oct 2023 23:24:53 +0200 Subject: [PATCH 2/3] update message after importing softsign key --- src/commands/softsign/import.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/softsign/import.rs b/src/commands/softsign/import.rs index b945dbe3..891d9675 100644 --- a/src/commands/softsign/import.rs +++ b/src/commands/softsign/import.rs @@ -60,16 +60,16 @@ impl Runnable for ImportCommand { status_err!("{}", e); process::exit(1); }); + info!("Imported Ed25519 private key to {}", output_path.display()); } PrivateKey::Secp256k1(sk) => { key_utils::write_base64_secret(output_path, &sk.to_bytes()).unwrap_or_else(|e| { status_err!("{}", e); process::exit(1); }); + info!("Imported Secp256k1 private key to {}", output_path.display()); } _ => unreachable!("unsupported priv_validator.json algorithm"), } - - info!("Imported Ed25519 private key to {}", output_path.display()); } } From 1d52fd0d95e4fcd25d55e1815d63d06a5fe4c9af Mon Sep 17 00:00:00 2001 From: Mateusz Kaczanowski Date: Mon, 16 Oct 2023 23:29:40 +0200 Subject: [PATCH 3/3] run rustfmt --- src/commands/softsign/import.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/softsign/import.rs b/src/commands/softsign/import.rs index 891d9675..41a4fdfe 100644 --- a/src/commands/softsign/import.rs +++ b/src/commands/softsign/import.rs @@ -67,7 +67,10 @@ impl Runnable for ImportCommand { status_err!("{}", e); process::exit(1); }); - info!("Imported Secp256k1 private key to {}", output_path.display()); + info!( + "Imported Secp256k1 private key to {}", + output_path.display() + ); } _ => unreachable!("unsupported priv_validator.json algorithm"), }