Skip to content

Commit

Permalink
core/key: add a helper to gen ed25519 key in bech32m format
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Feb 8, 2023
1 parent 20a4296 commit 6a3ddd9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/src/types/key/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,21 @@ impl super::SigScheme for SigScheme {
}
}
}

mod tests {
use super::*;
use crate::types::key::ed25519;

/// Run `cargo test gen_ed25519_keypair -- --nocapture` to generate a
/// new ed25519 keypair wrapped in `common` key types.
#[test]
fn gen_ed25519_keypair() {
let secret_key =
SecretKey::Ed25519(crate::types::key::testing::gen_keypair::<
ed25519::SigScheme,
>());
let public_key = secret_key.to_public();
println!("Public key: {}", public_key);
println!("Secret key: {}", secret_key);
}
}

0 comments on commit 6a3ddd9

Please sign in to comment.