From 8e9b07c32507d16bb11f238e839b248304015201 Mon Sep 17 00:00:00 2001 From: Anna Carroll Date: Tue, 15 Oct 2024 17:15:36 -0500 Subject: [PATCH] tweak rollup tests for inheritability --- test/Orders.t.sol | 18 ++++++++---------- test/Passage.t.sol | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/test/Orders.t.sol b/test/Orders.t.sol index 6133e9d..06aa0a8 100644 --- a/test/Orders.t.sol +++ b/test/Orders.t.sol @@ -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; @@ -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); @@ -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)); diff --git a/test/Passage.t.sol b/test/Passage.t.sol index e49a231..f48dab5 100644 --- a/test/Passage.t.sol +++ b/test/Passage.t.sol @@ -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));