Add differential fuzzing for invoice and operator privilege boundary test - #516
Merged
misrasamuelisiguzor-oss merged 2 commits intoAug 31, 2026
Conversation
|
@amandasmyths 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! 🚀 |
…rivilege boundary test Fixes WHEELBACK#471: Add differential fuzzing harness comparing invoice's amount-validation logic against Python reference implementation to catch logic bugs that might be shared between implementation and test when both in the same language. Fixes WHEELBACK#472: Add test verifying compliance's require_admin_or_operator correctly distinguishes operator from admin privileges, confirming operator can call address_status but is rejected from admin-only operations like allow_address, block_address, and clear_address. Changes: - scripts/reference_amount_validation.py: Minimal Python reference implementation of amount/precision validation rules - contracts/invoice/tests/amount_validation_differential_test.rs: Differential fuzzing test with canonical cases, boundary cases, and off-by-one tests - contracts/compliance/tests/operator_privilege_boundary_test.rs: Tests verifying operator vs admin privilege separation - contracts/compliance/src/lib.rs: Add DataKey::LastBulkAllow and LastBulkBlock variants for bulk operation cooldown tracking - contracts/invoice/Cargo.toml: Add serde_json dev dependency for test infrastructure
amandasmyths
force-pushed
the
feat/invoice-compliance-tests
branch
from
August 29, 2026 13:40
e351af7 to
58a81e9
Compare
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
Implements two issues that improve test coverage and catch potential logic bugs through differential testing:
Resolves
Closes #471
Closes #472
Changes
Issue #471 - Differential Fuzzing for Invoice Amount Validation:
scripts/reference_amount_validation.py: Minimal Python reference implementation of invoice amount/precision validation rulescontracts/invoice/tests/amount_validation_differential_test.rs: Differential fuzzing test that:contracts/invoice/Cargo.toml: Added serde_json dev dependency for JSON communication with Python scriptIssue #472 - Operator Privilege Boundary Test:
contracts/compliance/tests/operator_privilege_boundary_test.rs: 6 comprehensive tests that verify:address_status(operator-permitted endpoint)allow_address,block_address,clear_address(admin-only operations)contracts/compliance/src/lib.rs: Added missingDataKeyvariants (LastBulkAllow,LastBulkBlock) required by bulk operation cooldown trackingTesting
Both test suites pass:
cargo test --package comebackhere-invoice --test amount_validation_differential_test✓ (3/3 tests pass)cargo test --package comebackhere-compliance --test operator_privilege_boundary_test✓ (6/6 tests pass)The differential test validates that Rust and Python implementations produce identical results across 1000+ test vectors covering: