From f4fdfc066e7fc7d0730ca833386f23fcb75a90b6 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:08:39 -0500 Subject: [PATCH] added L2 testing --- .../unit/common/FeeHandlerSeller.t.sol | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol b/packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol index dc4ca181cd..15fadbae48 100644 --- a/packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol +++ b/packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol @@ -3,17 +3,16 @@ pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; // Helper contracts -import { Test } from "celo-foundry/Test.sol"; -import { TestConstants } from "@test-sol/constants.sol"; import { CeloTokenMock } from "@test-sol/unit/common/CeloTokenMock.sol"; import { FeeHandlerSeller } from "@celo-contracts/common/FeeHandlerSeller.sol"; import { MentoFeeHandlerSeller } from "@celo-contracts/common/MentoFeeHandlerSeller.sol"; import { UniswapFeeHandlerSeller } from "@celo-contracts/common/UniswapFeeHandlerSeller.sol"; -import "@celo-contracts/common/interfaces/IRegistry.sol"; +import { Utils } from "@test-sol/utils.sol"; +import "@test-sol/utils/WhenL2.sol"; -contract FeeHandlerSellerTest is Test, TestConstants { +contract FeeHandlerSellerTest is Utils { event OracleAddressSet(address _token, address _oracle); // Actors @@ -32,8 +31,7 @@ contract FeeHandlerSellerTest is Test, TestConstants { FeeHandlerSeller[] feeHandlerSellerInstances; function setUp() public { - deployCodeTo("Registry.sol", abi.encode(false), REGISTRY_ADDRESS); - IRegistry registry = IRegistry(REGISTRY_ADDRESS); + super.setUp(); celoToken = new CeloTokenMock(); oracle = actor("oracle"); @@ -49,6 +47,8 @@ contract FeeHandlerSellerTest is Test, TestConstants { } } +contract FeeHandlerSellerTest_L2 is WhenL2, FeeHandlerSellerTest {} + contract FeeHandlerSellerTest_Transfer is FeeHandlerSellerTest { uint256 constant ZERO_CELOTOKEN = 0; uint256 constant ONE_CELOTOKEN = 1e18; @@ -94,6 +94,11 @@ contract FeeHandlerSellerTest_Transfer is FeeHandlerSellerTest { } } +contract FeeHandlerSellerTest_Transfer_L2 is + FeeHandlerSellerTest_L2, + FeeHandlerSellerTest_Transfer +{} + contract FeeHandlerSellerTest_SetMinimumReports is FeeHandlerSellerTest { address ARBITRARY_TOKEN_ADDRESS = actor("Arbitrary Token Address"); uint256 constant ARBITRARY_NR_OF_MINIMUM_REPORTS = 15; @@ -128,6 +133,11 @@ contract FeeHandlerSellerTest_SetMinimumReports is FeeHandlerSellerTest { } } +contract FeeHandlerSellerTest_SetMinimumReports_L2 is + FeeHandlerSellerTest_L2, + FeeHandlerSellerTest_SetMinimumReports +{} + contract FeeHandlerSellerTest_setOracleAddress is FeeHandlerSellerTest { function test_Reverts_WhenCalledByNonOwner() public { vm.prank(NON_OWNER_ADDRESS); @@ -151,3 +161,8 @@ contract FeeHandlerSellerTest_setOracleAddress is FeeHandlerSellerTest { uniswapFeeHandlerSeller.setOracleAddress(address(celoToken), oracle); } } + +contract FeeHandlerSellerTest_setOracleAddress_L2 is + FeeHandlerSellerTest_L2, + FeeHandlerSellerTest_setOracleAddress +{}