DEVREL-568 feat: Add slim TestHelper for LayerZero foundry testing - #1605
Closed
St0rmBr3w wants to merge 14 commits into
Closed
DEVREL-568 feat: Add slim TestHelper for LayerZero foundry testing#1605St0rmBr3w wants to merge 14 commits into
St0rmBr3w wants to merge 14 commits into
Conversation
ravinagill15
left a comment
Contributor
There was a problem hiding this comment.
Thank you for implementing this!
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
reviewed
Jul 25, 2025
shankars99
requested changes
Jul 25, 2025
shankars99
left a comment
Collaborator
There was a problem hiding this comment.
Would also be good to make all the no-op function virtual so that someone, if they want can override it and have a custom EndpointV2Simple or something.
will re-review after any changes
shankars99
approved these changes
Aug 16, 2025
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.
In this PR:
This PR introduces a lightweight testing infrastructure for LayerZero OApp developers using Foundry. It addresses compilation issues, enables
forge coverage, and provides a cleaner import structure without sacrificing essential testing capabilities.Problems Addressed
TestHelperOz5) cause "Stack too deep" compilation errors, requiring--via-irflagforge coverageon projects using existing test infrastructureSolution
Created a parallel "slim" testing infrastructure that maintains backward compatibility while dramatically reducing complexity.
Major Changes
1. New
LzTestHelperSlimContract (packages/test-devtools-evm-foundry/contracts/LzTestHelperSlim.sol)TestHelperOz5(~316 lines vs 700+ lines)LibraryTypesupport (SimpleMessageLib)Testand customOptionsHelper2. New
EndpointV2SimpleMock (packages/test-devtools-evm-foundry/contracts/mocks/EndpointV2Simple.sol)3. Simplified
SimpleMessageLibMock(packages/test-devtools-evm-foundry/contracts/mocks/SimpleMessageLibMock.sol)TestHelperOz5dependency4. Example Updates (
examples/oft/test/foundry/MyOFT.t.sol)TestHelperOz5toLzTestHelperSlimKey Design Decisions
What's Included
What's Excluded
Rationale: These features are better tested in integration environments (localnet)
Results
Compilation
Coverage
Import Size
Migration Guide
Benefits
--via-irRequired: Contracts compile with standard optimizer settingsTesting Philosophy
Verification
forge testworks without special flagsforge coveragegenerates reports successfullyFuture Considerations
TestHelperOz5for advanced protocol testing needsLzTestHelperSlimbecomes the recommended default for OApp developers