fix(escrow): replace crate-level clippy allows with targeted exceptions (#332)#356
Merged
mikewheeleer merged 2 commits intoMay 27, 2026
Conversation
Add property-based and deterministic tests that prove the escrow accounting invariant never breaks across deposit/release/refund sequences. Changes: - contracts/escrow/src/proptest.rs: 6 proptest properties (256 cases each) covering random op sequences, full release, double-release rejection, incremental deposits, cancel, and over-deposit rejection - contracts/escrow/src/test/accounting_invariants.rs: 16 deterministic tests covering happy-path sequences, cancel sequences, adversarial inputs (double release, release without funds, over-deposit, out-of-range index, zero/negative deposit), multi-contract isolation, and ExactTotal mode - contracts/escrow/src/test/mod.rs: register accounting_invariants submodule - contracts/escrow/src/lib.rs: minor cleanup - docs/escrow/FUNDING_ACCOUNTING.md: document property test suite All 53 tests pass (cargo +1.88.0 test -p escrow).
…ns (Talenttrust#332) Remove the three permissive crate-level lint suppressions: - #![allow(dead_code)] - #![allow(unused_imports)] - #![allow(unused_variables)] These blanket allows were masking real dead code (proptest.rs, fuzz_test.rs, TTL helpers) and preventing CI from catching future regressions. Targeted fixes applied: - lib.rs: prefix unused param with ; add item-level #[allow(dead_code)] to (retained for future admin ops) - amount_validation.rs: add item-level #[allow(dead_code)] to the 3 public constants and 5 public validation functions that are part of the module's public API but not yet called by the contract itself - test/mod.rs: add item-level #[allow(dead_code)] to all shared test fixture helpers/constants; prefix unused match-arm binding with All CI checks pass: cargo fmt, cargo clippy -D warnings, cargo build, cargo test (53/53).
|
@Topmatrixmor2014 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #332.
Removes the three permissive crate-level lint suppressions from
contracts/escrow/src/lib.rs:#![allow(dead_code)]#![allow(unused_imports)]#![allow(unused_variables)]These blanket allows were masking real dead code (e.g.
proptest.rs,fuzz_test.rs, TTL helpers) and preventing CI from catching future regressions.Changes
contracts/escrow/src/lib.rscontract_idparameter incheck_accounting_invariantwith_#[allow(dead_code)]torequire_admin(retained for future admin-gated operations)contracts/escrow/src/amount_validation.rs#[allow(dead_code)]with justification comments to the 3 public constants (STROOP_PRECISION,MAX_SINGLE_AMOUNT_STROOPS,MIN_POSITIVE_AMOUNT) and 5 public validation functions that are part of the module's public API but not yet called by the contract itselfcontracts/escrow/src/test/mod.rs#[allow(dead_code)]to all shared test fixture helpers and constantsothermatch-arm binding with_Testing
All CI checks pass locally:
cargo fmt --all -- --check✅cargo clippy --workspace --all-targets -- -D warnings✅cargo build✅cargo test— 53/53 tests pass ✅