Skip to content

Commit

Permalink
Passing L2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Nov 20, 2024
1 parent ce06e83 commit 37b0d32
Showing 1 changed file with 96 additions and 1 deletion.
97 changes: 96 additions & 1 deletion packages/protocol/test-sol/unit/common/FeeHandler.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ contract FeeHandlerTest_SetCarbonFraction is FeeHandlerTest {
}
}

contract FeeHandlerTest_SetCarbonFraction_L2 is
FeeHandlerTest_L2,
FeeHandlerTest_SetCarbonFraction
{}

// TODO change beneficiary allocation
contract FeeHandlerTest_changeOtherBeneficiaryAllocation is FeeHandlerTest {
function setUp() public {
Expand Down Expand Up @@ -306,6 +311,11 @@ contract FeeHandlerTest_changeOtherBeneficiaryAllocation is FeeHandlerTest {
}
}

contract FeeHandlerTest_changeOtherBeneficiaryAllocation_L2 is
FeeHandlerTest_L2,
FeeHandlerTest_changeOtherBeneficiaryAllocation
{}

contract FeeHandlerTest_SetHandler is FeeHandlerTest {
function test_Reverts_WhenCallerNotOwner() public {
vm.prank(user);
Expand All @@ -323,6 +333,8 @@ contract FeeHandlerTest_SetHandler is FeeHandlerTest {
}
}

contract FeeHandlerTest_SetHandler_L2 is FeeHandlerTest_L2, FeeHandlerTest_SetHandler {}

contract FeeHandlerTest_AddToken is FeeHandlerTest {
function test_Reverts_WhenCallerNotOwner() public {
vm.prank(user);
Expand All @@ -346,6 +358,8 @@ contract FeeHandlerTest_AddToken is FeeHandlerTest {
}
}

contract FeeHandlerTest_AddToken_L2 is FeeHandlerTest_L2, FeeHandlerTest_AddToken {}

contract FeeHandlerTest_RemoveToken is FeeHandlerTest {
function test_Reverts_WhenCallerNotOwner() public {
vm.prank(user);
Expand All @@ -369,6 +383,8 @@ contract FeeHandlerTest_RemoveToken is FeeHandlerTest {
}
}

contract FeeHandlerTest_RemoveToken_L2 is FeeHandlerTest_L2, FeeHandlerTest_RemoveToken {}

contract FeeHandlerTest_DeactivateAndActivateToken is FeeHandlerTest {
function test_Reverts_WhenActivateCallerNotOwner() public {
vm.prank(user);
Expand Down Expand Up @@ -396,6 +412,11 @@ contract FeeHandlerTest_DeactivateAndActivateToken is FeeHandlerTest {
}
}

contract FeeHandlerTest_DeactivateAndActivateToken_L2 is
FeeHandlerTest_L2,
FeeHandlerTest_DeactivateAndActivateToken
{}

contract FeeHandlerTest_SetFeeBeneficiary is FeeHandlerTest {
function test_Reverts_WhenCallerNotOwner() public {
vm.prank(user);
Expand All @@ -415,6 +436,11 @@ contract FeeHandlerTest_SetFeeBeneficiary is FeeHandlerTest {
}
}

contract FeeHandlerTest_SetFeeBeneficiary_L2 is
FeeHandlerTest_L2,
FeeHandlerTest_SetFeeBeneficiary
{}

contract FeeHandlerTestAbstract is FeeHandlerTest {
function addAndActivateToken(address token, address handler) public {
feeHandler.addToken(token, handler);
Expand Down Expand Up @@ -443,6 +469,8 @@ contract FeeHandlerTestAbstract is FeeHandlerTest {
}
}

contract FeeHandlerTestAbstract_L2 is FeeHandlerTest_L2, FeeHandlerTestAbstract {}

contract FeeHandlerTest_AddOtherBeneficiary is FeeHandlerTestAbstract {
// TODO only owner
function test_addsSucsesfully() public {
Expand Down Expand Up @@ -508,6 +536,11 @@ contract FeeHandlerTest_AddOtherBeneficiary is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_AddOtherBeneficiary_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_AddOtherBeneficiary
{}

contract FeeHandlerTest_Distribute is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -577,6 +610,8 @@ contract FeeHandlerTest_Distribute is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_Distribute_L2 is FeeHandlerTestAbstract_L2, FeeHandlerTest_Distribute {}

contract FeeHandlerTest_Distribute_WhenOtherBeneficiaries is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -625,6 +660,11 @@ contract FeeHandlerTest_Distribute_WhenOtherBeneficiaries is FeeHandlerTestAbstr
}
}

contract FeeHandlerTest_Distribute_WhenOtherBeneficiaries_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_Distribute_WhenOtherBeneficiaries
{}

// function test_HandleCelo_WhenThereAreMoreTwoOtherBeneficiaries() public {
// feeHandler.addOtherBeneficiary(
// op,
Expand Down Expand Up @@ -686,6 +726,8 @@ contract FeeHandlerTest_BurnCelo is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_BurnCelo_L2 is FeeHandlerTestAbstract_L2, FeeHandlerTest_BurnCelo {}

contract FeeHandlerTest_SellMentoTokensAbstract is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand All @@ -694,6 +736,11 @@ contract FeeHandlerTest_SellMentoTokensAbstract is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_SellMentoTokensAbstract_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_SellMentoTokensAbstract
{}

contract FeeHandlerTest_SellMentoTokens_WhenTokenEnabled is FeeHandlerTest_SellMentoTokensAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -831,16 +878,26 @@ contract FeeHandlerTest_SellMentoTokens_WhenTokenEnabled is FeeHandlerTest_SellM
}
}

contract FeeHandlerTest_SellMentoTokens_WhenTokenEnabled_L2 is
FeeHandlerTest_SellMentoTokensAbstract_L2,
FeeHandlerTest_SellMentoTokens_WhenTokenEnabled
{}

contract FeeHandlerTest_SellMentoTokens_WhenTokenNotEnabled is
FeeHandlerTest_SellMentoTokensAbstract
{
function test_() public {
function test_Reverts_WhenSelling() public {
fundFeeHandlerStable(3000, address(stableToken), address(exchangeUSD));
vm.expectRevert("Token needs to be active to sell");
feeHandler.sell(address(stableToken));
}
}

contract FeeHandlerTest_SellMentoTokens_WhenTokenNotEnabled_L2 is
FeeHandlerTest_SellMentoTokensAbstract_L2,
FeeHandlerTest_SellMentoTokens_WhenTokenNotEnabled
{}

contract FeeHandlerTest_SellNonMentoTokens is FeeHandlerTestAbstract {
uint256 deadline;

Expand Down Expand Up @@ -994,6 +1051,11 @@ contract FeeHandlerTest_SellNonMentoTokens is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_SellNonMentoTokens_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_SellNonMentoTokens
{}

contract FeeHandlerTest_HandleCelo is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -1044,6 +1106,8 @@ contract FeeHandlerTest_HandleCelo is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_HandleCelo_L2 is FeeHandlerTestAbstract_L2, FeeHandlerTest_HandleCelo {}

contract FeeHandlerTest_HandleMentoTokens is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -1072,6 +1136,11 @@ contract FeeHandlerTest_HandleMentoTokens is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_HandleMentoTokens_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_HandleMentoTokens
{}

contract FeeHandlerTest_HandleAll is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -1105,6 +1174,8 @@ contract FeeHandlerTest_HandleAll is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_HandleAll_L2 is FeeHandlerTestAbstract_L2, FeeHandlerTest_HandleAll {}

contract FeeHandlerTest_Transfer is FeeHandlerTest {
modifier mintToken(uint256 amount) {
tokenA.mint(address(feeHandler), amount);
Expand All @@ -1123,6 +1194,8 @@ contract FeeHandlerTest_Transfer is FeeHandlerTest {
}
}

contract FeeHandlerTest_Transfer_L2 is FeeHandlerTest_L2, FeeHandlerTest_Transfer {}

contract FeeHandlerTest_SetDailySellLimit is FeeHandlerTest {
uint256 newCeloAmountForRate;

Expand All @@ -1149,6 +1222,11 @@ contract FeeHandlerTest_SetDailySellLimit is FeeHandlerTest {
}
}

contract FeeHandlerTest_SetDailySellLimit_L2 is
FeeHandlerTest_L2,
FeeHandlerTest_SetDailySellLimit
{}

contract FeeHandlerTest_SetMaxSlippage is FeeHandlerTest {
uint256 newMaxSlipapge;

Expand All @@ -1175,6 +1253,8 @@ contract FeeHandlerTest_SetMaxSlippage is FeeHandlerTest {
}
}

contract FeeHandlerTest_SetMaxSlippage_L2 is FeeHandlerTest_L2, FeeHandlerTest_SetMaxSlippage {}

contract FeeHandlerTest_RemoveOtherBeneficiary is FeeHandlerTestAbstract {
event BeneficiaryRemoved(address beneficiary);
function setUp() public {
Expand Down Expand Up @@ -1213,6 +1293,11 @@ contract FeeHandlerTest_RemoveOtherBeneficiary is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_RemoveOtherBeneficiary_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_RemoveOtherBeneficiary
{}

contract FeeHandlerTest_SetBeneficiaryFraction is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -1246,6 +1331,11 @@ contract FeeHandlerTest_SetBeneficiaryFraction is FeeHandlerTestAbstract {
}
}

contract FeeHandlerTest_SetBeneficiaryFraction_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_SetBeneficiaryFraction
{}

contract FeeHandlerTest_SetBeneficiaryName is FeeHandlerTestAbstract {
function setUp() public {
super.setUp();
Expand Down Expand Up @@ -1279,3 +1369,8 @@ contract FeeHandlerTest_SetBeneficiaryName is FeeHandlerTestAbstract {
feeHandler.setBeneficiaryName(op, "OP revenue share updated");
}
}

contract FeeHandlerTest_SetBeneficiaryName_L2 is
FeeHandlerTestAbstract_L2,
FeeHandlerTest_SetBeneficiaryName
{}

0 comments on commit 37b0d32

Please sign in to comment.