Skip to content

Conversation

@letmehateu
Copy link

Motivation

The validation logic for setUp and afterInvariant functions in ContractRunner::run_tests() was duplicated (~50 lines). This made the code harder to maintain and would require updating multiple places when adding new special functions.

Solution

Extracted a reusable validate_special_function() helper method that handles validation for any special test function. This eliminates code duplication and makes it easy to add validation for future special functions.
The validation behavior remains functionally identical to the previous implementation.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes
Copy link
Member

this is worse

@DaniPopes DaniPopes closed this Nov 27, 2025
@github-project-automation github-project-automation bot moved this to Done in Foundry Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants