Test/contracts blocklist precedence tests - #180
Merged
mikewheeleer merged 2 commits intoJul 17, 2026
Merged
Conversation
Author
|
Note on CI: the repository's CI currently fails to build due to an unrelated upstream dependency issue — the |
Contributor
|
nice one — thanks for this! |
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.
Closes #176
Summary
Adds focused test coverage for the per-agent blocklist (
set_agent_blocked,is_agent_blocked,AgentBlocked/#17) inrecord_usage, and locks down its precedence over the allowlist. No changes tocontracts/escrow/src/lib.rs— the existing implementation was correct; this is test-only.Coverage added
#17.is_agent_blockedround-trips (false → true → false).#17, not#10— proving the block check fires before the allowlist check.running 207 tests
...
test result: FAILED. 202 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.59s
Note on the 5 failures: these are pre-existing on
mainat the current HEAD (test_nonadmin_settle_without_metadata_rejected,test_owner_cannot_settle_other_service,test_record_usage_accumulates_across_calls,test_record_usage_contract_exactly_one_event_per_call,test_record_usage_isolates_services_and_large_deltas) — verified they fail identically on a clean checkout ofmainwith none of this PR's changes applied, so they're unrelated to this PR. All new and existing blocklist tests pass.cargo fmt --all -- --checkandcargo buildboth pass clean.