From ed119fa307eba5613e3396cc7c72572c23286169 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 11 Oct 2024 11:19:13 -0700 Subject: [PATCH 1/2] feat: add workflows --- .github/workflows/pr.yaml | 40 ++++++++++++++++++++++++++++++++++ .github/workflows/pr_lint.yaml | 22 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/pr_lint.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..5683a82 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,40 @@ +name: PR + +on: + push: + branches: [main] + pull_request: + branches: + - "**" + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Formatting & Clippy + runs-on: [runs-on, runner=4cpu-linux-arm64 , "run-id=${{ github.run_id }}"] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + + - name: Run rustfmt + run: cargo fmt --all -- --check + env: + CARGO_INCREMENTAL: 1 + + - name: Run cargo clippy + run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features + env: + CARGO_INCREMENTAL: 1 \ No newline at end of file diff --git a/.github/workflows/pr_lint.yaml b/.github/workflows/pr_lint.yaml new file mode 100644 index 0000000..45bfa0a --- /dev/null +++ b/.github/workflows/pr_lint.yaml @@ -0,0 +1,22 @@ +name: PR Lint + +on: + pull_request_target: + types: + - opened + - edited + +permissions: + pull-requests: read + +jobs: + main: + name: Title + runs-on: + - runs-on + - runner=2cpu-linux-arm64 + - run-id=${{ github.run_id }} + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 832a75bf4528cb797d04261d23d5c0bd9b572b3b Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 11 Oct 2024 11:21:41 -0700 Subject: [PATCH 2/2] allow dead code --- verifier/src/converter.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/verifier/src/converter.rs b/verifier/src/converter.rs index 5dd59d7..a6fa377 100644 --- a/verifier/src/converter.rs +++ b/verifier/src/converter.rs @@ -42,6 +42,7 @@ pub(crate) fn deserialize_with_flags(buf: &[u8]) -> Result<(Fq, CompressedPointF } } +#[allow(dead_code)] pub(crate) fn compressed_x_to_g1_point(buf: &[u8]) -> Result { let (x, m_data) = deserialize_with_flags(buf)?; let (y, neg_y) = AffineG1::get_ys_from_x_unchecked(x).ok_or(Error::InvalidPoint)?; @@ -86,6 +87,7 @@ pub(crate) fn uncompressed_bytes_to_g1_point(buf: &[u8]) -> Result Result { if buf.len() != 64 { return Err(Error::InvalidXLength);