From 0ca52a36eea737172b775485ff220f46b31cfc75 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Thu, 1 Dec 2022 11:52:52 -0500 Subject: [PATCH] Restore type complexity checks in CI Passes due to the remaining type complexity cases being explicitly allowed. --- .github/workflows/tests.yml | 2 +- crypto/dkg/src/frost.rs | 2 ++ crypto/dleq/src/cross_group/aos.rs | 2 +- crypto/dleq/src/cross_group/mod.rs | 3 +++ crypto/multiexp/src/batch.rs | 1 + processor/src/wallet.rs | 2 ++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fca895a..999dede3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: rust-components: clippy - name: Run Clippy - run: cargo clippy --all-features -- -D warnings -A clippy::type_complexity -A dead_code + run: cargo clippy --all-features -- -D warnings -A dead_code deny: runs-on: ubuntu-latest diff --git a/crypto/dkg/src/frost.rs b/crypto/dkg/src/frost.rs index 343a176f..c65f69e6 100644 --- a/crypto/dkg/src/frost.rs +++ b/crypto/dkg/src/frost.rs @@ -249,6 +249,7 @@ pub struct SecretShareMachine { impl SecretShareMachine { /// Verify the data from the previous round (canonicity, PoKs, message authenticity) + #[allow(clippy::type_complexity)] fn verify_r1( &mut self, rng: &mut R, @@ -286,6 +287,7 @@ impl SecretShareMachine { /// Continue generating a key. /// Takes in everyone else's commitments. Returns a HashMap of secret shares to be sent over /// authenticated channels to their relevant counterparties. + #[allow(clippy::type_complexity)] pub fn generate_secret_shares( mut self, rng: &mut R, diff --git a/crypto/dleq/src/cross_group/aos.rs b/crypto/dleq/src/cross_group/aos.rs index 3ae5256b..008b5f75 100644 --- a/crypto/dleq/src/cross_group/aos.rs +++ b/crypto/dleq/src/cross_group/aos.rs @@ -78,7 +78,7 @@ where (((generators.0.alt * s.0) - (A.0 * e.0)), ((generators.1.alt * s.1) - (A.1 * e.1))) } - #[allow(non_snake_case)] + #[allow(non_snake_case, clippy::type_complexity)] fn R_batch( generators: (Generators, Generators), s: (G0::Scalar, G1::Scalar), diff --git a/crypto/dleq/src/cross_group/mod.rs b/crypto/dleq/src/cross_group/mod.rs index 6b5fe2d5..b7ef05c2 100644 --- a/crypto/dleq/src/cross_group/mod.rs +++ b/crypto/dleq/src/cross_group/mod.rs @@ -183,6 +183,7 @@ where res } + #[allow(clippy::type_complexity)] fn prove_internal( rng: &mut R, transcript: &mut T, @@ -283,6 +284,7 @@ where /// It also ensures a lack of determinable relation between keys, guaranteeing security in the /// currently expected use case for this, atomic swaps, where each swap leaks the key. Knowing /// the relationship between keys would allow breaking all swaps after just one. + #[allow(clippy::type_complexity)] pub fn prove( rng: &mut R, transcript: &mut T, @@ -304,6 +306,7 @@ where /// Prove the cross-Group Discrete Log Equality for the points derived from the scalar passed in, /// failing if it's not mutually valid. This allows for rejection sampling externally derived /// scalars until they're safely usable, as needed. + #[allow(clippy::type_complexity)] pub fn prove_without_bias( rng: &mut R, transcript: &mut T, diff --git a/crypto/multiexp/src/batch.rs b/crypto/multiexp/src/batch.rs index 784735f3..3fd07733 100644 --- a/crypto/multiexp/src/batch.rs +++ b/crypto/multiexp/src/batch.rs @@ -8,6 +8,7 @@ use group::Group; use crate::{multiexp, multiexp_vartime}; /// A batch verifier intended to verify a series of statements are each equivalent to zero. +#[allow(clippy::type_complexity)] #[derive(Clone, Zeroize)] pub struct BatchVerifier(Vec<(Id, Vec<(G::Scalar, G)>)>); diff --git a/processor/src/wallet.rs b/processor/src/wallet.rs index 89bc90f7..63126912 100644 --- a/processor/src/wallet.rs +++ b/processor/src/wallet.rs @@ -180,6 +180,7 @@ fn refine_inputs( } } +#[allow(clippy::type_complexity)] fn select_inputs_outputs( inputs: &mut Vec, outputs: &mut Vec<(C::Address, u64)>, @@ -200,6 +201,7 @@ fn select_inputs_outputs( (selected, outputs) } +#[allow(clippy::type_complexity)] pub struct Wallet { db: D, coin: C,