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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant