test: add integration test for proposals which need ETH#80
test: add integration test for proposals which need ETH#80thelostone-mc merged 5 commits intoaudit-fixesfrom
Conversation
7984d36 to
1b38f90
Compare
1b38f90 to
5ed5d0e
Compare
9ceca0c to
781a1e4
Compare
apbendi
left a comment
There was a problem hiding this comment.
Looks good, a couple of thoughts on how we can expand these as fuzz tests
|
|
||
| /// @notice Test that a proposal requiring ETH works when we send ETH along with the execute call | ||
| /// @dev This test demonstrates the scenario where ETH is sent WITH the execute call (not FROM the timelock) | ||
| function test_ProposalRequiringEth_WorksWhenEthIsSentAlongWithExecuteCall() external { |
There was a problem hiding this comment.
Can we fuz the amount required here? And fuzz the executor to show it can be any address.
There was a problem hiding this comment.
Did this but it's causing the test to run 30min +
There was a problem hiding this comment.
Ended breaking the test into 2 tests where 1 we fuzz the executor and the other we fuzz the amount
f6e9f03 to
972141c
Compare
fc94a53 to
911e7b3
Compare
- scenario where timelock has eth - scenario when eth is sent along with execute
972141c to
5be06f2
Compare
0a3f2b8 to
cccd113
Compare
cccd113 to
670e43d
Compare
apbendi
left a comment
There was a problem hiding this comment.
A couple small comments but overall looking good
| /// @notice Internal helper function to test ETH proposal execution | ||
| /// @dev This contains the core test logic that can be reused by different fuzz tests | ||
| function _testProposalRequiringEthAndEthIsSentWithExecuteCall(uint256 _requiredEthAmount, address _executor) internal { | ||
| // 0. Verify initial state - contract should have no ETH initially |
There was a problem hiding this comment.
nit: comment implies we're verifying, but we're just recording/saving the balance, not verifying them in any way.
| govHelper.submitPassAndQueue(proposer, ethProposal); | ||
|
|
||
| // 4. Execute with ETH using the specified executor | ||
| if (_executor != address(this)) { |
There was a problem hiding this comment.
What is the point of this check? Why does it matter if the fuzzer chooses the test contract address?
|
Coverage after merging timelock-eth-test into audit-fixes will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||
To be merged after the medium severity issues are resolved