From 8c50a316332a107cbd3dd51c7a42f7496da92632 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Tue, 6 Aug 2024 00:27:54 -0400 Subject: [PATCH] Improve documentation on functions --- substrate/primitives/src/account.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/substrate/primitives/src/account.rs b/substrate/primitives/src/account.rs index 0fe63a28..5c77c28f 100644 --- a/substrate/primitives/src/account.rs +++ b/substrate/primitives/src/account.rs @@ -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(name: &str) -> C::F { C::hash_to_F(b"insecure arbitrary key", name.as_bytes())