Skip to content

Commit

Permalink
Merge branch 'master' into feat/commit-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
steven committed Nov 3, 2023
2 parents c53d893 + d498377 commit 4143701
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/test/unit/EigenPodManagerUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ contract EigenPodManagerUnitTests_Initialization_Setters is EigenPodManagerUnitT
assertEq(eigenPodManager.maxPods(), newMaxPods, "Max pods not updated");
}

function testFuzz_updateBeaconChainOracle_revert_notOwner(address notOwner) public {
function testFuzz_updateBeaconChainOracle_revert_notOwner(address notOwner) public filterFuzzedAddressInputs(notOwner) {
cheats.assume(notOwner != initialOwner);
cheats.prank(notOwner);
cheats.expectRevert("Ownable: caller is not the owner");
Expand Down Expand Up @@ -330,7 +330,7 @@ contract EigenPodManagerUnitTests_ShareUpdateTests is EigenPodManagerUnitTests {
Remove Shares Tests
******************************************************************************/

function testFuzz_removeShares_revert_notDelegationManager(address notDelegationManager) public {
function testFuzz_removeShares_revert_notDelegationManager(address notDelegationManager) public filterFuzzedAddressInputs(notDelegationManager) {
cheats.assume(notDelegationManager != address(delegationManagerMock));
cheats.prank(notDelegationManager);
cheats.expectRevert("EigenPodManager.onlyDelegationManager: not the DelegationManager");
Expand Down Expand Up @@ -384,7 +384,7 @@ contract EigenPodManagerUnitTests_ShareUpdateTests is EigenPodManagerUnitTests {
assertEq(eigenPodManager.podOwnerShares(defaultStaker), int256(sharesAdded - sharesRemoved), "Incorrect number of shares removed");
}

function testFuzz_removeShares_zeroShares(address podOwner, uint256 shares) public {
function testFuzz_removeShares_zeroShares(address podOwner, uint256 shares) public filterFuzzedAddressInputs(podOwner) {
// Constrain inputs
cheats.assume(podOwner != address(0));
cheats.assume(shares % GWEI_TO_WEI == 0);
Expand Down Expand Up @@ -488,7 +488,7 @@ contract EigenPodManagerUnitTests_ShareUpdateTests is EigenPodManagerUnitTests {

contract EigenPodManagerUnitTests_BeaconChainETHBalanceUpdateTests is EigenPodManagerUnitTests {

function testFuzz_recordBalanceUpdate_revert_notPod(address invalidCaller) public deployPodForStaker(defaultStaker) {
function testFuzz_recordBalanceUpdate_revert_notPod(address invalidCaller) public filterFuzzedAddressInputs(invalidCaller) deployPodForStaker(defaultStaker) {
cheats.assume(invalidCaller != defaultStaker);
cheats.prank(invalidCaller);
cheats.expectRevert("EigenPodManager.onlyEigenPod: not a pod");
Expand Down
5 changes: 4 additions & 1 deletion src/test/unit/EigenPodUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ contract EigenPodUnitTests is Test, ProofParsing {
eigenPodManager.createPod();
cheats.stopPrank();
pod = eigenPodManager.getPod(podOwner);

// Filter 0 address
fuzzedAddressMapping[address(0x0)] = true;
}

function testStakingWithInvalidAmount () public {
Expand Down Expand Up @@ -434,7 +437,7 @@ contract EigenPodUnitTests is Test, ProofParsing {
require(vw.amountToSendGwei == partialWithdrawalAmountGwei, "newAmount should be partialWithdrawalAmountGwei");
}

function testRecoverTokens(uint256 amount, address recipient) external {
function testRecoverTokens(uint256 amount, address recipient) external fuzzedAddress(recipient) {
cheats.assume(amount > 0 && amount < 1e30);
IERC20 randomToken = new ERC20PresetFixedSupply(
"rand",
Expand Down

0 comments on commit 4143701

Please sign in to comment.