Skip to content

refactor(test): improve ProtocolVersions test coverage and quality#6

Open
aliersh wants to merge 1 commit intodevelopfrom
devin/1725405038-enhance-protocol-versions-tests
Open

refactor(test): improve ProtocolVersions test coverage and quality#6
aliersh wants to merge 1 commit intodevelopfrom
devin/1725405038-enhance-protocol-versions-tests

Conversation

@aliersh
Copy link
Owner

@aliersh aliersh commented Sep 3, 2025

refactor(test): improve ProtocolVersions test coverage and quality

Summary

Enhanced the ProtocolVersions test suite following established testing guidelines:

  • Added bounds to fuzz tests: Applied bound(_version, 0, type(uint128).max) to testFuzz_setRequired_succeeds and testFuzz_setRecommended_succeeds for more realistic testing ranges
  • Added missing test coverage: Created ProtocolVersions_Version_Test contract to test the version() function that was previously untested
  • Reorganized test structure: Reordered test contracts to match the source contract's function declaration order (Version → Initialize → SetRequired → SetRecommended)

All tests pass including heavy fuzz testing with 20,000 runs each.

Review & Testing Checklist for Human

  • Verify bound appropriateness: Confirm type(uint128).max upper bound aligns with actual protocol version values used in deploy configs (e.g., mainnet uses 0x0000000000000000000000000000000000000003000000010000000000000000)
  • Run full test suite: Execute just test-dev --match-path test/L1/ProtocolVersions.t.sol -v to ensure no regressions
  • Validate version test: Confirm the new version test provides sufficient coverage for the version() getter function

Notes

- add bounds to fuzz tests for realistic protocol version ranges
- add test for version() function coverage
- reorganize test contracts to match source function declaration order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant