-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import {BaseBundler} from "src/mocks/bundlers/BaseBundlerMock.sol"; | ||
|
||
import "./helpers/LocalTest.sol"; | ||
|
||
contract BaseBundlerLocalEnshrinedTest is BaseBundler, LocalTest { | ||
function checkInitiator(address expectedInitiator) public payable protected { | ||
require(initiator() == expectedInitiator, "unexpected initiator"); | ||
} | ||
|
||
function revertWith(string memory data) public payable protected { | ||
revert(data); | ||
} | ||
|
||
function testMulticallShouldSetTheRightInitiator(address caller) public { | ||
bundle.push(abi.encodeCall(this.checkInitiator, (caller))); | ||
|
||
vm.prank(caller); | ||
this.multicall(bundle); | ||
} | ||
|
||
function testMulticallShouldPassRevertData(string memory data) public { | ||
bundle.push(abi.encodeCall(this.revertWith, (data))); | ||
|
||
vm.expectRevert(bytes(data)); | ||
this.multicall(bundle); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters