Get clippy to pass across the repo

This commit is contained in:
Luke Parker
2024-08-05 23:29:51 -04:00
parent 2ae2883106
commit 89fc88b283
18 changed files with 171 additions and 144 deletions

View File

@@ -18,6 +18,8 @@ workspace = true
[dependencies]
zeroize = { version = "^1.5", features = ["derive"], optional = true }
ciphersuite = { path = "../../crypto/ciphersuite", default-features = false, optional = true }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }
@@ -35,7 +37,7 @@ frame-support = { git = "https://github.com/serai-dex/substrate", default-featur
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
[features]
std = ["zeroize", "scale/std", "borsh?/std", "serde?/std", "scale-info/std", "sp-core/std", "sp-runtime/std", "frame-support/std"]
std = ["zeroize", "ciphersuite/std", "scale/std", "borsh?/std", "serde?/std", "scale-info/std", "sp-core/std", "sp-runtime/std", "frame-support/std"]
borsh = ["dep:borsh"]
serde = ["dep:serde"]
default = ["std"]

View File

@@ -95,6 +95,16 @@ 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.
///
/// 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.
#[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())
}
pub struct AccountLookup;
impl Lookup for AccountLookup {
type Source = SeraiAddress;