Skip to content

chore: clean up invariant test files#295

Merged
jackchuma merged 2 commits into
mainfrom
chore/simplify-invariant-tests
May 19, 2026
Merged

chore: clean up invariant test files#295
jackchuma merged 2 commits into
mainfrom
chore/simplify-invariant-tests

Conversation

@jackchuma

@jackchuma jackchuma commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Cleans up the invariant tests for CrossDomainMessenger and SafeCall to reduce duplication and clarify intent.

  • Refactor CrossDomainMessenger.t.sol: collapse the success/failure invariants down to a single badRelayResult flag, move shared setup into a base contract, drop unused imports/sender exclusions, and tighten naming/comments.
  • Refactor SafeCall.t.sol: introduce a shared SafeCall_Invariants base, replace the numCalls counters with a badCallResult flag, extract magic numbers into named constants, and use assumeUnusedAddress instead of hand-rolled to.code.length checks.

No behavioral changes to the invariants themselves — same scenarios are exercised, just with less boilerplate.

@cb-heimdall

cb-heimdall commented May 19, 2026

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
@jackchuma jackchuma merged commit f834bed into main May 19, 2026
6 checks passed
@jackchuma jackchuma deleted the chore/simplify-invariant-tests branch May 19, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants