Skip to content

fix: satisfy cargo fmt and clippy in the Rust crates - #5

Merged
soumen0818 merged 1 commit into
mainfrom
midnight
Sep 8, 2026
Merged

fix: satisfy cargo fmt and clippy in the Rust crates#5
soumen0818 merged 1 commit into
mainfrom
midnight

Conversation

@soumen0818

Copy link
Copy Markdown
Owner

CI caught formatting I never ran. I formatted the Go and TypeScript changes but not the Rust, so two lines I wrote in Phase 0.3 exceeded rustfmt's width and failed cargo fmt --all --check in both the circuits and contracts workflows.

Running the full gate set locally then surfaced two real problems that cargo test --test pool_circuits alone never showed:

  • a SpendCircuit::new call site inside src/pool/ffi.rs was still passing 13 arguments. It lives in an inline #[cfg(test)] module, so only clippy --all-targets (or cargo test --lib) compiles it.

  • spend_proof_from_the_ffi_path_verifies built a 15-element public input list and asserted len() == 15, so it failed with MalformedVerifyingKey against the now-17-IC key. That test is the one asserting a phone's proof will be accepted on-chain, so it is worth keeping honest: it now supplies min_kyc_level explicitly rather than letting serde's default fill it, which would have passed while testing a different statement.

Every gate in every workflow now passes locally: circuits (fmt, test), contracts (fmt, clippy -D warnings, test, wasm build), backend (vet, build, test), shared (typecheck, build), mobile (typecheck, lint, format:check).

CI caught formatting I never ran. I formatted the Go and TypeScript
changes but not the Rust, so two lines I wrote in Phase 0.3 exceeded
rustfmt's width and failed `cargo fmt --all --check` in both the circuits
and contracts workflows.

Running the full gate set locally then surfaced two real problems that
`cargo test --test pool_circuits` alone never showed:

  - a SpendCircuit::new call site inside src/pool/ffi.rs was still
    passing 13 arguments. It lives in an inline #[cfg(test)] module, so
    only `clippy --all-targets` (or `cargo test --lib`) compiles it.

  - spend_proof_from_the_ffi_path_verifies built a 15-element public
    input list and asserted len() == 15, so it failed with
    MalformedVerifyingKey against the now-17-IC key. That test is the one
    asserting a phone's proof will be accepted on-chain, so it is worth
    keeping honest: it now supplies min_kyc_level explicitly rather than
    letting serde's default fill it, which would have passed while
    testing a different statement.

Every gate in every workflow now passes locally: circuits (fmt, test),
contracts (fmt, clippy -D warnings, test, wasm build), backend (vet,
build, test), shared (typecheck, build), mobile (typecheck, lint,
format:check).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 381ada79-2139-40b8-a4de-dbad4fa73219


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@soumen0818
soumen0818 merged commit d2136c5 into main Sep 8, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant