From ae6be2d9ab3bb25a7202678b60b4ab9dd2a24474 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 13:17:52 -0800 Subject: [PATCH] Fix typos and add a job to CI (#351) * fix typos with typos tool * add to CI * fix typos * add permissions * use commit hash * use commit hash * Update .github/workflows/rust.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/rust.yml | 12 ++++++++++++ src/gadgets/ecc.rs | 14 +++++++------- src/gadgets/nonnative/bignat.rs | 4 ++-- src/provider/poseidon/poseidon_inner.rs | 4 ++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0cea2dce..b2b4cfe5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,5 +1,9 @@ name: Build and Test Nova +permissions: + contents: read + pull-requests: write + on: push: branches: [ main ] @@ -74,3 +78,11 @@ jobs: with: command: clippy args: --all-targets -- -D warnings + + spelling: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Spell Check Repo + uses: crate-ci/typos@685eb3d55be2f85191e8c84acb9f44d7756f84ab diff --git a/src/gadgets/ecc.rs b/src/gadgets/ecc.rs index ef204dab..edccb588 100644 --- a/src/gadgets/ecc.rs +++ b/src/gadgets/ecc.rs @@ -912,7 +912,7 @@ mod tests { } /// Make the point io - pub fn inputize_allocted_point>( + pub fn inputize_allocated_point>( p: &AllocatedPoint, mut cs: CS, ) { @@ -994,7 +994,7 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let s = E::Scalar::random(&mut OsRng); // Allocate bits for s @@ -1006,7 +1006,7 @@ mod tests { .collect::, SynthesisError>>() .unwrap(); let e = a.scalar_mul(cs.namespace(|| "Scalar Mul"), &bits).unwrap(); - inputize_allocted_point(&e, cs.namespace(|| "inputize e")); + inputize_allocated_point(&e, cs.namespace(|| "inputize e")); (a, e, s) } @@ -1060,9 +1060,9 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let e = a.add(cs.namespace(|| "add a to a"), &a).unwrap(); - inputize_allocted_point(&e, cs.namespace(|| "inputize e")); + inputize_allocated_point(&e, cs.namespace(|| "inputize e")); (a, e) } @@ -1115,13 +1115,13 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let b = &mut a.clone(); b.y = AllocatedNum::alloc(cs.namespace(|| "allocate negation of a"), || { Ok(E::Base::ZERO) }) .unwrap(); - inputize_allocted_point(b, cs.namespace(|| "inputize b")); + inputize_allocated_point(b, cs.namespace(|| "inputize b")); let e = a.add(cs.namespace(|| "add a to b"), b).unwrap(); e } diff --git a/src/gadgets/nonnative/bignat.rs b/src/gadgets/nonnative/bignat.rs index eab03447..98052b50 100644 --- a/src/gadgets/nonnative/bignat.rs +++ b/src/gadgets/nonnative/bignat.rs @@ -493,7 +493,7 @@ impl BigNat { }) } - /// Compute a `BigNat` contrained to be equal to `self * other % modulus`. + /// Compute a `BigNat` constrained to be equal to `self * other % modulus`. pub fn mult_mod>( &self, mut cs: CS, @@ -564,7 +564,7 @@ impl BigNat { Ok((quotient, remainder)) } - /// Compute a `BigNat` contrained to be equal to `self * other % modulus`. + /// Compute a `BigNat` constrained to be equal to `self * other % modulus`. pub fn red_mod>( &self, mut cs: CS, diff --git a/src/provider/poseidon/poseidon_inner.rs b/src/provider/poseidon/poseidon_inner.rs index ab98efe4..97316bf3 100644 --- a/src/provider/poseidon/poseidon_inner.rs +++ b/src/provider/poseidon/poseidon_inner.rs @@ -128,13 +128,13 @@ where /// Generates new instance of [`PoseidonConstants`] suitable for both optimized / non-optimized hashing /// with following default parameters: /// - 128 bit of security; - /// - Merkle Tree (where all leafs are presented) domain separation ([`HashType`]). + /// - Merkle Tree (where all leaves are presented) domain separation ([`HashType`]). pub fn new() -> Self { Self::new_with_strength(DEFAULT_STRENGTH) } /// Generates new instance of [`PoseidonConstants`] suitable for both optimized / non-optimized hashing - /// with Merkle Tree (where all leafs are presented) domain separation ([`HashType`]) custom security level ([`Strength`]). + /// with Merkle Tree (where all leaves are presented) domain separation ([`HashType`]) custom security level ([`Strength`]). pub fn new_with_strength(strength: Strength) -> Self { Self::new_with_strength_and_type(strength, HashType::MerkleTree) }