From 562b64e943ccd3c523d90c5a89ea83dbfbde1c63 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 28 Mar 2024 11:10:26 +0100 Subject: [PATCH] Don't set the `js` feature for `getrandom` (#40) * change: libraries should not impose the js feature chore: update criterion to latest * chore: features for wasm targets * chore: appease clippy --- Cargo.toml | 13 +++++++++++-- src/sign/signature.rs | 5 +---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ec8cbc1..99fe654 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,15 +24,24 @@ ark-ff = { version = "0.4", default-features = false } ark-ec = { version = "0.4", default-features = false } ark-serialize = { version = "0.4", default-features = false, features = ["derive"] } digest = { version = "0.10", default-features = false, features = ["alloc"] } -getrandom = { version = "0.2", default-features = false, features = ["js"] } rand = { version = "0.8", default-features = false, features = ["alloc", "getrandom", "libc"] } sha2 = { version = "0.10", default-features = false } aes-gcm = { version = "0.10", default-features = false, features = ["aes", "alloc", "getrandom", "zeroize"] } hkdf = { version = "0.12", default-features = false } zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] } +# Include the "js" feature for wasm32-unknown-unknown +[target.'cfg(target_family = "wasm")'.dependencies.getrandom] +version = "0.2" +default-features = false +features = ["js"] + +[target.'cfg(not(target_family = "wasm"))'.dependencies.getrandom] +version = "0.2.0" +default-features = false + [dev-dependencies] -criterion = { version = "0.3" } +criterion = { version = "0.5" } [[bench]] name = "dkg" diff --git a/src/sign/signature.rs b/src/sign/signature.rs index 33957f0..72bdd1d 100644 --- a/src/sign/signature.rs +++ b/src/sign/signature.rs @@ -556,10 +556,7 @@ impl SignatureAggregator> { } // Ensure that our new state is ordered and deduplicated. - self.state.signers = { - let signers = self.get_signers().clone(); - signers - }; + let _ = self.get_signers(); for signer in &self.state.signers { if self