Skip to content

Commit

Permalink
Last cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Oct 5, 2024
1 parent 9015245 commit bbd28cc
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions packages/protocol/test-sol/unit/common/FeeHandler.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,29 @@ contract FeeHandlerTest is Test, TestConstants {
}
}

contract FeeHandlerTest_Initialize is FeeHandlerTest {
function test_Reverts_WhenAlreadyInitialized() public {
vm.expectRevert("contract already initialized");
feeHandler.initialize(
REGISTRY_ADDRESS,
EXAMPLE_BENEFICIARY_ADDRESS,
0,
new address[](0),
new address[](0),
new uint256[](0),
new uint256[](0)
);
}

function test_registryAddressSet() public {
assertEq(address(feeHandler.registry()), REGISTRY_ADDRESS);
}

function test_FeeBeneficiarySet() public {
assertEq(feeHandler.feeBeneficiary(), EXAMPLE_BENEFICIARY_ADDRESS);
}
}

contract FeeHandlerTest_SetBurnFraction is FeeHandlerTest {
function test_Reverts_WhenCallerNotOwner() public {
vm.prank(user);
Expand All @@ -223,7 +246,7 @@ contract FeeHandlerTest_SetBurnFraction is FeeHandlerTest {
);
}

function test_ShouldEmitFeeBeneficiarySet() public {
function test_ShouldEmitBurnFractionSet() public {
vm.expectEmit(true, true, true, true);
emit BurnFractionSet(FixidityLib.newFixedFraction(80, 100).unwrap());
feeHandler.setBurnFraction(FixidityLib.newFixedFraction(80, 100).unwrap());
Expand Down Expand Up @@ -342,7 +365,6 @@ contract FeeHandlerTest_SetFeeBeneficiary is FeeHandlerTest {
contract FeeHandlerTestAbstract is FeeHandlerTest {
function addAndActivateToken(address token, address handler) public {
feeHandler.addToken(token, handler);
feeHandler.activateToken(token); // TODO line probaly not needed
}

function setBurnFraction(uint256 numerator, uint256 denominator) internal {
Expand All @@ -362,11 +384,6 @@ contract FeeHandlerTestAbstract is FeeHandlerTest {
feeHandler.setMaxSplippage(stableTokenAddress, slippage);
}

function setUpBeneficiary() public {
//TODO borrar
feeHandler.setFeeBeneficiary(EXAMPLE_BENEFICIARY_ADDRESS);
}

function fundFeeHandlerWithCelo() public {
uint256 celoAmount = 1e18;
celoToken.transfer(address(feeHandler), celoAmount);
Expand Down

0 comments on commit bbd28cc

Please sign in to comment.