Skip to content

test: give the empty-hashes assertion a failure message - #42

Merged
jacderida merged 1 commit into
mainfrom
chrisoneil/v2-1399-update-all-crates-for-the-new-rust-release
Oct 1, 2026
Merged

jacderida merged 1 commit into
mainfrom
chrisoneil/v2-1399-update-all-crates-for-the-new-rust-release

Conversation

@jacderida

Copy link
Copy Markdown
Member

Rust 1.99 (released 2026-09-28) adds the pedantic clippy lint assert_is_empty, which this crate
picks up through its blanket pedantic = { level = "warn" }. CI runs with -D warnings, so
assert!(hashes.is_empty()) in payment::proof's tests now fails the clippy job — the same tree
passed clippy on 1.98.1.

The lint's point is that a bare assert! prints nothing useful when it fails; clippy's own
suggestion is assert_eq!(hashes, [] as [TxHash; 0]). A message carrying the value gives the same
diagnostic and reads better in a test, so that is what this uses.

One of four PRs for V2-1399, which sweeps the new toolchain's lints across the crates; the others
are in saorsa-transport, saorsa-core and ant-node. This repo had just the one site.

Linear issue

Closes V2-1399

Risk tier

  • T0 — docs / tooling / CI / pure UX-output. Repo CI only.
  • T1 — client-only, no network-facing behavior change. CI + prod compat smoke.
  • T2 — node/client logic with behavioral surface, no protocol/format/economics change. Dev testnet + ADR.
  • T3 — protocol / storage format / payments / routing. T2 evidence + adversarial testing.

Test-only change: one assertion in a #[cfg(test)] module gains a failure message.

Compatibility

  • Wire: none
  • Storage: none
  • API: none

Semver impact

  • breaking
  • feature
  • fix

Test evidence

T0: repo CI only. Run on 1.99.0 (b940084d7, 2026-09-28), the toolchain that produced the failure:

  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets --all-features -- -D warnings (the clippy job, verbatim) — clean
  • cargo check --lib --no-default-features --target wasm32-unknown-unknown and the same with
    --features rpc (the WASM portability job) — clean

Test suites were not run locally; CI runs them on this PR. The assertion's condition is unchanged,
so test_payment_proof_with_empty_tx_hashes passes or fails exactly as before.

New dependency

none

ADR

n/a

Mitigation / rollback

Revert the commit.

🤖 Generated with Claude Code

Rust 1.99 adds the pedantic clippy lint `assert_is_empty`, which this crate picks up through its
blanket `pedantic = "warn"`, so `assert!(hashes.is_empty())` now fails CI's `-D warnings`. The
lint's point is that a bare `assert!` prints nothing useful on failure; clippy's own suggestion
is `assert_eq!(hashes, [] as [TxHash; 0])`, so a message carrying the value reads better and
gives the same diagnostic.

Verified on 1.99.0 with `cargo fmt --all -- --check` and
`cargo clippy --all-targets --all-features -- -D warnings`.

Closes V2-1399

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

@dirvine dirvine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after focused review of head 1fee1b1548da36ecde0e692a1e5be9af7c8e1a80. No blocking findings.

Test-only diagnostic addition. The empty-hashes assertion predicate is unchanged; hashes are formatted only on failure. CI checks, including Clippy, tests and WASM portability, pass.

Review scope: full PR diff and relevant source/API semantics, live CI and review-thread inspection, plus one lightweight GLM-5.2 independent cross-check (no full panel). No local crate build/test run; execution evidence is GitHub CI.

@jacderida
jacderida merged commit 4f34aa8 into main Oct 1, 2026
12 checks passed
@jacderida
jacderida deleted the chrisoneil/v2-1399-update-all-crates-for-the-new-rust-release branch October 1, 2026 20:14
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.

2 participants