Skip to content

Commit

Permalink
Merge branch 'martinvol/allowFeeHandlerDistributeWithoutBurn' of gith…
Browse files Browse the repository at this point in the history
…ub.com:celo-org/celo-monorepo into martinvol/allowFeeHandlerDistributeWithoutBurn
  • Loading branch information
martinvol committed Oct 31, 2024
2 parents 469b22c + 4dba853 commit 8a7ac5b
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/Accounts.sol";
import "@celo-contracts/common/GoldToken.sol";
import "@celo-contracts-8/common/test/MockEpochManager.sol";
import "@celo-contracts-8/common/interfaces/IPrecompiles.sol";
import "@celo-contracts/governance/interfaces/IValidators.sol";

Expand All @@ -27,13 +26,13 @@ import { Utils } from "@test-sol/utils.sol";
import { Test as ForgeTest } from "forge-std/Test.sol";
import "@test-sol/unit/governance/validators/mocks/ValidatorsMockTunnel.sol";
import "@test-sol/unit/governance/voting/mocks/ReleaseGoldMockTunnel.sol";
import "@test-sol/unit/common/mocks/MockEpochManager.sol";

contract RevokeCeloAfterL2Transition is Test, TestConstants, ECDSAHelper, Utils {
using FixidityLib for FixidityLib.Fraction;

uint256 constant TOTAL_AMOUNT = 1 ether * 1_000_000;

Registry registry;
Accounts accounts;
MockStableToken stableToken;
Election election;
Expand All @@ -43,7 +42,6 @@ contract RevokeCeloAfterL2Transition is Test, TestConstants, ECDSAHelper, Utils
Governance governance;
GoldToken goldToken;
ReleaseGold releaseGold;
MockEpochManager epochManager;

address owner;
address accApprover;
Expand All @@ -55,7 +53,6 @@ contract RevokeCeloAfterL2Transition is Test, TestConstants, ECDSAHelper, Utils
address beneficiary;
address refundAddress;
address releaseOwner;
address epochManagerAddress = actor("epochManagerAddress");

address authorizedValidatorSigner;
uint256 authorizedValidatorSignerPK;
Expand Down Expand Up @@ -171,8 +168,8 @@ contract RevokeCeloAfterL2Transition is Test, TestConstants, ECDSAHelper, Utils
)
.unwrap();

deployCodeTo("Registry.sol", abi.encode(false), REGISTRY_ADDRESS);
registry = Registry(REGISTRY_ADDRESS);
setupRegistry();
setupEpochManager();

accounts = new Accounts(true);
stableToken = new MockStableToken();
Expand All @@ -187,8 +184,6 @@ contract RevokeCeloAfterL2Transition is Test, TestConstants, ECDSAHelper, Utils
goldToken = new GoldToken(true);
releaseGold = new ReleaseGold(true);

epochManager = new MockEpochManager();

registry.setAddressFor(AccountsContract, address(accounts));
registry.setAddressFor(ElectionContract, address(election));
registry.setAddressFor(StableTokenContract, address(stableToken));
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/test-sol/unit/common/EpochManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ contract EpochManagerTest is Test, TestConstants, Utils08 {
vm.prank(epochManagerEnabler);
epochManager.initializeSystem(firstEpochNumber, firstEpochBlock, firstElected);

travelEpochL2(vm);
travelNL2Epoch(vm, 1);
}

function getGroupsWithLessersAndGreaters()
Expand All @@ -186,7 +186,7 @@ contract EpochManagerTest is Test, TestConstants, Utils08 {

function _travelAndProcess_N_L2Epoch(uint256 n) public {
for (uint256 i = 0; i < n; i++) {
travelEpochL2(vm);
travelNL2Epoch(vm, 1);
epochManager.startNextEpochProcess();

(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
pragma solidity >=0.5.13 <0.9.0;
// solhint-disable no-unused-vars

import "../../../contracts/common/interfaces/IEpochManager.sol";
import "../../../../contracts/common/interfaces/IEpochManager.sol";

/**
* @title A mock EpochManager for testing.
* @title A mock EpochManager for testing with 0.5.
*/

contract MockEpochManager is IEpochManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ contract BlockchainParametersTest is Test, TestConstants, Utils {
ph.setEpochSize(DAY / 5);
blockchainParameters = new BlockchainParameters(true);
}
function _whenL2() public {
deployCodeTo("Registry.sol", abi.encode(false), PROXY_ADMIN_ADDRESS);
}
}

contract BlockchainParametersTest_initialize is BlockchainParametersTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ contract EpochRewardsTest is Test, TestConstants, Utils {
);
}

function _whenL2() public {
deployCodeTo("Registry.sol", abi.encode(false), PROXY_ADMIN_ADDRESS);
}
function getExpectedTargetTotalSupply(uint256 timeDelta) internal pure returns (uint256) {
uint256 genesisSupply = 600000000 ether;
uint256 linearRewards = 200000000 ether;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ contract GovernanceTest is Test, TestConstants, Utils {
uint256 proposalId;
address constant proxyAdminAddress = 0x4200000000000000000000000000000000000018;

function _whenL2() public {
deployCodeTo("Registry.sol", abi.encode(false), proxyAdminAddress);
}

function setUp() public {
// Define Accounts
accVoter = actor("voter");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,6 @@ contract DowntimeSlasherTest is Test, TestConstants, Utils {
}
return (_epochNumber.sub(1)).mul(epochSize).add(1);
}

function _whenL2() public {
deployCodeTo("Registry.sol", abi.encode(false), PROXY_ADMIN_ADDRESS);
}
}

contract DowntimeSlasherTestInitialize is DowntimeSlasherTest {
Expand Down
Loading

0 comments on commit 8a7ac5b

Please sign in to comment.