File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
src/tests/integration/test-data Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ AddConst.applyOp(uint256)
22ArithmeticCallTest.test_double_add(uint256,uint256)
33ArithmeticCallTest.test_double_add_double_sub(uint256,uint256)
44ArithmeticCallTest.test_double_add_sub_external(uint256,uint256,uint256)
5+ ArithmeticCallTest.test_double_add_sub_external_revert(uint256,uint256,uint256)
6+ ArithmeticCallTest.test_double_add_sub_external_prank(uint256,uint256,uint256)
57ArithmeticContract.add(uint256,uint256)
68ArithmeticContract.add_sub_external(uint256,uint256,uint256)
79CallableStorageContract.str()
Original file line number Diff line number Diff line change @@ -30,4 +30,22 @@ contract ArithmeticCallTest is Test {
3030 a = arith.add_sub_external (a, y, z);
3131 assert (a > x);
3232 }
33+
34+ function test_double_add_sub_external_revert (uint x , uint y , uint z ) external {
35+ vm.assume (x == type (uint256 ).max);
36+ vm.assume (y > 0 );
37+
38+ // the call should revert due to overflow in `add`
39+ vm.expectRevert ();
40+ uint a = arith.add_sub_external (x, y, z);
41+ assert (a > x);
42+ }
43+
44+ function test_double_add_sub_external_prank (uint x , uint y , uint z ) external {
45+ address prankCaller = address (0xBEEF );
46+
47+ vm.prank (prankCaller);
48+ uint a = arith.add_sub_external (x, y, z);
49+ assert (a > x);
50+ }
3351}
You can’t perform that action at this time.
0 commit comments