Skip to content

Commit

Permalink
chore: edit ci toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
RajeshRk18 committed Feb 12, 2024
1 parent 274cd7a commit 2425af5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
name: test

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
name: test suite
on: [push, pull_request]

jobs:
nargo:
test:
name: nargo test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Nargo
uses: noir-lang/[email protected]
- uses: actions/checkout@v3
- uses: noir-lang/[email protected]
with:
toolchain: nightly

- name: Run nargo test
run: |
nargo test
toolchain: 0.22.0
- run: nargo test
14 changes: 7 additions & 7 deletions src/poly.nr
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Polynomial {
}
}

pub fn from(coeffs: Vec<PrimeField>) -> Self {
pub fn from_coeffs(coeffs: Vec<PrimeField>) -> Self {
Self {
coeffs
}
Expand All @@ -50,7 +50,7 @@ impl Polynomial {

padded_coeffs.push(coeff);

Polynomial::from(padded_coeffs)
Polynomial::from_coeffs(padded_coeffs)
}

// outputs the polynomial size which is usually highest degree + 1
Expand Down Expand Up @@ -107,7 +107,7 @@ impl Polynomial {
new_coeffs.push(res);
}

Polynomial::from(new_coeffs)
Polynomial::from_coeffs(new_coeffs)
}

// subtracts two polnomials
Expand Down Expand Up @@ -145,7 +145,7 @@ impl Polynomial {
}
let res_coeffs: [PrimeField] = res_coeffs;

poly = Polynomial::from(Vec::from_slice(res_coeffs));
poly = Polynomial::from_coeffs(Vec::from_slice(res_coeffs));
}

poly
Expand All @@ -166,7 +166,7 @@ impl Polynomial {
}
}

Polynomial::from(coeffs)
Polynomial::from_coeffs(coeffs)
}

// negates a polynomial
Expand All @@ -180,7 +180,7 @@ impl Polynomial {
}
}

Polynomial::from(coeffs)
Polynomial::from_coeffs(coeffs)
}

// subtract the 0th degree coefficient from a field element
Expand Down Expand Up @@ -211,7 +211,7 @@ fn test_poly3() {
let mut coeff = Vec::new();
coeff.push(PrimeField::from_u56(7));

let eq1 = Polynomial::from(coeff);
let eq1 = Polynomial::from_coeffs(coeff);
let eq2 = Polynomial::new_monomial(PrimeField::from_u56(6), 0);
let eq3 = Polynomial::new_monomial(PrimeField::from_u56(13), 0);

Expand Down

0 comments on commit 2425af5

Please sign in to comment.