Skip to content

Commit

Permalink
Fix typos and add a job to CI (#351)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
  • Loading branch information
srinathsetty and Copilot authored Jan 6, 2025
1 parent e90666d commit ae6be2d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build and Test Nova

permissions:
contents: read
pull-requests: write

on:
push:
branches: [ main ]
Expand Down Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/gadgets/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ mod tests {
}

/// Make the point io
pub fn inputize_allocted_point<E: Engine, CS: ConstraintSystem<E::Base>>(
pub fn inputize_allocated_point<E: Engine, CS: ConstraintSystem<E::Base>>(
p: &AllocatedPoint<E>,
mut cs: CS,
) {
Expand Down Expand Up @@ -994,7 +994,7 @@ mod tests {
CS: ConstraintSystem<E::Base>,
{
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
Expand All @@ -1006,7 +1006,7 @@ mod tests {
.collect::<Result<Vec<AllocatedBit>, 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)
}

Expand Down Expand Up @@ -1060,9 +1060,9 @@ mod tests {
CS: ConstraintSystem<E::Base>,
{
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)
}

Expand Down Expand Up @@ -1115,13 +1115,13 @@ mod tests {
CS: ConstraintSystem<E::Base>,
{
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
}
Expand Down
4 changes: 2 additions & 2 deletions src/gadgets/nonnative/bignat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl<Scalar: PrimeField> BigNat<Scalar> {
})
}

/// 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<CS: ConstraintSystem<Scalar>>(
&self,
mut cs: CS,
Expand Down Expand Up @@ -564,7 +564,7 @@ impl<Scalar: PrimeField> BigNat<Scalar> {
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<CS: ConstraintSystem<Scalar>>(
&self,
mut cs: CS,
Expand Down
4 changes: 2 additions & 2 deletions src/provider/poseidon/poseidon_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit ae6be2d

Please sign in to comment.