From 791e0b9fa4989cd583f9074f423b656139732383 Mon Sep 17 00:00:00 2001 From: Mateusz Kaczanowski Date: Tue, 17 Oct 2023 01:02:31 +0200 Subject: [PATCH] fix importing softsign secp256k1 key type (#790) --- src/commands/softsign/import.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/commands/softsign/import.rs b/src/commands/softsign/import.rs index 63a8ac37..41a4fdfe 100644 --- a/src/commands/softsign/import.rs +++ b/src/commands/softsign/import.rs @@ -60,10 +60,19 @@ 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()); } }