test(settlement): add per-entrypoint auth snapshot tests - #973
Merged
greatest0fallt1me merged 3 commits intoJul 29, 2026
Merged
Conversation
Add per-entrypoint auth snapshot tests for the CalloraSettlement contract. Verifies that every state-changing entrypoint enforces require_auth and every read-only entrypoint does not require authorization. Covers 27 mutating entrypoints and 17 read-only views across: - Initialisation, accounting, payment processing - Developer limits, claim windows, daily withdraw caps - Admin/vault rotation, balance migration, storage migration - Batch settlement, broadcast, upgrade 45 tests total: 27 auth-requiring + 17 read-only + 1 smoke test + 1 inventory test.
|
@nonchalanttee22-lgtm 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! 🚀 |
Contributor
|
Green across the board — merging. Thanks! |
4 tasks
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
Adds snapshot tests in
contracts/settlement/tests/auth_snap.rsthat assert the exactrequire_authcalls made by each state-changing settlement entrypoint. This locks down the authorization surface so any future change to who must authorize a settlement operation is caught immediately by the snapshot diff.Closes #655
What changed
contracts/settlement/tests/auth_snap.rs(new)require_auth/require_auth_for_args)require_authcall is covered; entrypoints missing the call are flagged as test failuresEdge cases covered
Rustdoc
///rustdoc comments on each test describing the entrypoint under test and the expected authorization shapeHow to verify
cargo test -p settlement -- auth_snap --nocapture
require_authcall from a settlement entrypoint and confirm the corresponding snapshot test fails with a clear diffrequire_authcall and confirm the test suite flags itChecklist
contracts/settlement/tests/auth_snap.rscreated with one snapshot test per state-changing entrypoint///rustdoc comments on all test functionsunwrap()in production paths touched by this PRcargo test