Skip to content

Commit

Permalink
tweak rollup tests for inheritability
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-carroll committed Oct 15, 2024
1 parent 0fd4ad2 commit 8e9b07c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
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

0 comments on commit 8e9b07c

Please sign in to comment.