Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak rollup tests for inheritability #79

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
GnosisSafeTest:test_gnosis_receive() (gas: 15927)
OrderOriginPermit2Test:test_fillPermit2() (gas: 223464)
OrderOriginPermit2Test:test_fillPermit2_multi() (gas: 1007964)
OrderOriginPermit2Test:test_fillPermit2_multi() (gas: 1005464)
OrderOriginPermit2Test:test_initiatePermit2() (gas: 233946)
OrderOriginPermit2Test:test_initiatePermit2_multi() (gas: 981706)
OrderOriginPermit2Test:test_initiatePermit2_multi() (gas: 982006)
OrdersTest:test_fill_ERC20() (gas: 71459)
OrdersTest:test_fill_ETH() (gas: 69090)
OrdersTest:test_fill_both() (gas: 167814)
OrdersTest:test_fill_both() (gas: 169814)
OrdersTest:test_fill_multiETH() (gas: 132830)
OrdersTest:test_fill_underflowETH() (gas: 115817)
OrdersTest:test_initiate_ERC20() (gas: 82526)
OrdersTest:test_initiate_ETH() (gas: 45597)
OrdersTest:test_initiate_both() (gas: 119816)
OrdersTest:test_initiate_multiERC20() (gas: 719353)
OrdersTest:test_initiate_multiERC20() (gas: 175432)
OrdersTest:test_initiate_multiETH() (gas: 76000)
OrdersTest:test_orderExpired() (gas: 28383)
OrdersTest:test_sweepERC20() (gas: 60698)
OrdersTest:test_sweepERC20() (gas: 60695)
OrdersTest:test_sweepETH() (gas: 83379)
OrdersTest:test_underflowETH() (gas: 63976)
PassagePermit2Test:test_disallowedEnterPermit2() (gas: 691528)
PassagePermit2Test:test_disallowedEnterPermit2() (gas: 689028)
PassagePermit2Test:test_enterTokenPermit2() (gas: 144090)
PassageTest:test_configureEnter() (gas: 128735)
PassageTest:test_disallowedEnter() (gas: 57503)
Expand Down
18 changes: 8 additions & 10 deletions test/Orders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ contract OrdersTest is Test {
IOrders.Input[] public inputs;
IOrders.Output[] public outputs;

mapping(address => bool) isToken;

address token;
address token2;
uint32 chainId = 3;
address recipient = address(0x123);
uint256 amount = 200;
Expand All @@ -29,16 +28,20 @@ contract OrdersTest is Test {

event Sweep(address indexed recipient, address indexed token, uint256 amount);

function setUp() public {
function setUp() public virtual {
target = new RollupOrders(address(0));

// setup token
token = address(new TestERC20("hi", "HI"));
TestERC20(token).mint(address(this), amount * 10000);
TestERC20(token).approve(address(target), amount * 10000);
isToken[token] = true;

// setup Order Inputs/Outputs
// setup second token
token2 = address(new TestERC20("bye", "BYE"));
TestERC20(token2).mint(address(this), amount * 10000);
TestERC20(token2).approve(address(target), amount * 10000);

// setup simple Order Inputs/Outputs
IOrders.Input memory input = IOrders.Input(token, amount);
inputs.push(input);

Expand Down Expand Up @@ -90,11 +93,6 @@ contract OrdersTest is Test {

// input multiple ERC20s
function test_initiate_multiERC20() public {
// setup second token
address token2 = address(new TestERC20("bye", "BYE"));
TestERC20(token2).mint(address(this), amount * 10000);
TestERC20(token2).approve(address(target), amount * 10000);

// add second token input
inputs.push(IOrders.Input(token2, amount * 2));

Expand Down
2 changes: 1 addition & 1 deletion test/Passage.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ contract RollupPassageTest is Test {

event ExitToken(address indexed hostRecipient, address indexed token, uint256 amount);

function setUp() public {
function setUp() public virtual {
// deploy target
target = new RollupPassage(address(0));

Expand Down