Skip to content

Commit

Permalink
Merge pull request #2 from beeb/prank
Browse files Browse the repository at this point in the history
better repro
  • Loading branch information
grandizzy authored Oct 7, 2024
2 parents a3017df + bce9d2a commit 414e8c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions test/Counter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ contract CounterTest is Test {

targetContract(address(proxy));

targetSender(makeAddr("alice"));
targetSender(makeAddr("bob"));
address alice = makeAddr("alice");
address bob = makeAddr("bob");
vm.deal(alice, 100 ether);
vm.deal(bob, 100 ether);

targetSender(alice);
targetSender(bob);
}

function invariant_assume() public view {
Expand Down
5 changes: 3 additions & 2 deletions test/TestHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ contract TestHandler is Test, Initializable, UUPSUpgradeable {

function fuzzHandler(address addr, uint256 amount_) external {
amount_ = _bound(amount_, 500001, type(uint256).max);
addr = _boundAddress(addr);
vm.startPrank(msg.sender);
this.otherExternalFunction(amount_, _boundAddress(addr));
this.otherExternalFunction{value: 1000}(amount_, addr);
vm.stopPrank();
console.log("finished execution");
}
Expand All @@ -36,7 +37,7 @@ contract TestHandler is Test, Initializable, UUPSUpgradeable {
return addr;
}

function otherExternalFunction(uint256 amount_, address addr) external {
function otherExternalFunction(uint256 amount_, address addr) external payable {
amount = amount_;
test = addr;
}
Expand Down

0 comments on commit 414e8c1

Please sign in to comment.