Skip to content

Commit

Permalink
added L2 testing
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Nov 20, 2024
1 parent c71a412 commit f4fdfc0
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -151,3 +161,8 @@ contract FeeHandlerSellerTest_setOracleAddress is FeeHandlerSellerTest {
uniswapFeeHandlerSeller.setOracleAddress(address(celoToken), oracle);
}
}

contract FeeHandlerSellerTest_setOracleAddress_L2 is
FeeHandlerSellerTest_L2,
FeeHandlerSellerTest_setOracleAddress
{}

0 comments on commit f4fdfc0

Please sign in to comment.