-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🗞️ Allow expected reverts in verifyAndExecutePackets and fix forge coverage in TestHelper #615
Conversation
Should we add a revert argument for checking the composed delivery? |
This is also missing fixing the tests, or perhaps this is just PoC for now |
seems vm.expectRevert Foundry doesn't behave like it's documented in Vm.sol, related issue: foundry-rs/foundry#7629 Reported to Foundry team |
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
uint256 _packetAmount, | ||
address _composer, | ||
bytes memory _expectedReceiveRevertData, | ||
bytes memory _expectedComposeRevertData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know if I really agree on imbedding the expected revert data into the function like this, is there a functional reason why we dont just rely on the bubbled up revert and catch it with the vm.expectRevert inside of the test files implementation of this contract?
Otherwise it's unconventional compared to how you traditionally would read a testfile using vm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably do that if we expose more granular functions from the TestHelper, eg. split verification and execution of packets. Right now vm.expectRevert only allows to catch revert in next function call or something and it doesnt catch reverts properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @DanL0 , you can't just expectRevert() to be a catch-all for verifyPackets()
We should split this PR into seperate smaller ones: One for refactoring the endpoint setup to be more verbose. Excluding the "executeAndVerify" portion |
|
Depends on: