Skip to content

Commit

Permalink
Improve documentation on functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Aug 6, 2024
1 parent d943e03 commit 8c50a31
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions substrate/primitives/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ impl std::fmt::Display for SeraiAddress {
}
}

/// Create a Substraate key pair by a name.
///
/// This should never be considered to have a secure private key. It has effectively no entropy.
#[cfg(feature = "std")]
pub fn insecure_pair_from_name(name: &str) -> Pair {
Pair::from_string(&format!("//{name}"), None).unwrap()
}

/// Create a private key for an arbitrary curve by a name.
/// Create a private key for an arbitrary ciphersuite by a name.
///
/// This key is not in any regards to be treated as an actual private key, as it is not private,
/// nor is it even collision-resistant (crafted names may collide). It's solely for testing
/// purposes.
/// This key should never be considered a secure private key. It has effectively no entropy.
#[cfg(feature = "std")]
pub fn insecure_arbitrary_key_from_name<C: ciphersuite::Ciphersuite>(name: &str) -> C::F {
C::hash_to_F(b"insecure arbitrary key", name.as_bytes())
Expand Down

0 comments on commit 8c50a31

Please sign in to comment.