Skip to content

Commit 232ff9b

Browse files
authored
avoid expectRevert (#10)
1 parent 43e3df6 commit 232ff9b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ERC4626.test.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ abstract contract ERC4626Test is ERC4626Prop {
194194
vm.assume(assets > 0);
195195
_approve(_vault_, owner, caller, 0);
196196
vm.prank(caller);
197-
vm.expectRevert(); // We do not provide a specific revert reason, as it may vary depending on the implementation.
198-
IERC4626(_vault_).withdraw(assets, receiver, owner);
197+
(bool success,) = _vault_.call(
198+
abi.encodeWithSelector(IERC4626.withdraw.selector, assets, receiver, owner)
199+
);
200+
assertFalse(success);
199201
}
200202

201203
//
@@ -240,8 +242,10 @@ abstract contract ERC4626Test is ERC4626Prop {
240242
vm.assume(shares > 0);
241243
_approve(_vault_, owner, caller, 0);
242244
vm.prank(caller);
243-
vm.expectRevert(); // We do not provide a specific revert reason, as it may vary depending on the implementation.
244-
IERC4626(_vault_).redeem(shares, receiver, owner);
245+
(bool success,) = _vault_.call(
246+
abi.encodeWithSelector(IERC4626.redeem.selector, shares, receiver, owner)
247+
);
248+
assertFalse(success);
245249
}
246250

247251
//

0 commit comments

Comments
 (0)