Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soloseng/rename-utils-contract #11276

Merged
merged 6 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "@celo-contracts/governance/interfaces/IValidators.sol";
import "@celo-contracts-8/common/IsL2Check.sol";
import "@celo-contracts/common/PrecompilesOverrideV2.sol";

contract Utils is Test, TestConstants, IsL2Check, PrecompilesOverrideV2 {
contract TestWithUtils is Test, TestConstants, IsL2Check, PrecompilesOverrideV2 {
using EnumerableSet for EnumerableSet.AddressSet;

EnumerableSet.AddressSet addressSet;
Expand Down
7 changes: 2 additions & 5 deletions packages/protocol/test-sol/devchain/migration/05Links.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ import "@celo-contracts/common/Registry.sol";
import "@celo-contracts/common/UniswapFeeHandlerSeller.sol";
import "@celo-contracts/common/MentoFeeHandlerSeller.sol";

import "celo-foundry/Test.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import { TestConstants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";

contract BlockchainParametersTest is Test, TestConstants, Utils {
contract BlockchainParametersTest is TestWithUtils {
function test_dummy_test() public {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
Expand All @@ -20,15 +18,13 @@ import "@celo-contracts/stability/test/MockStableToken.sol";
import "@celo-contracts/governance/Election.sol";
import "@celo-contracts/governance/Governance.sol";

import { TestConstants } from "@test-sol/constants.sol";
import "@test-sol/utils/ECDSAHelper.sol";
import { Utils } from "@test-sol/utils.sol";
import { Test as ForgeTest } from "forge-std/Test.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.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 {
contract RevokeCeloAfterL2Transition is TestWithUtils, ECDSAHelper {
using FixidityLib for FixidityLib.Fraction;

uint256 constant TOTAL_AMOUNT = 1 ether * 1_000_000;
Expand Down
6 changes: 2 additions & 4 deletions packages/protocol/test-sol/unit/common/Accounts.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";
import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Accounts.sol";
import "@celo-contracts/governance/test/MockValidators.sol";

import { TestConstants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";

contract AccountsTest is Utils {
contract AccountsTest is TestWithUtils {
using FixidityLib for FixidityLib.Fraction;

Accounts accounts;
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/test-sol/unit/common/GoldToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pragma solidity ^0.5.13;

import "@celo-contracts/common/GoldToken.sol";

import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";

contract CeloTokenTest is Utils {
contract CeloTokenTest is TestWithUtils {
GoldToken celoToken;

uint256 constant ONE_CELOTOKEN = 1000000000000000000;
Expand Down
7 changes: 2 additions & 5 deletions packages/protocol/test-sol/unit/common/Proxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ pragma solidity ^0.5.13;

import "@celo-contracts/common/Proxy.sol";

import "celo-foundry/Test.sol";

import { TestConstants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import "@celo-contracts/common/test/GetSetV0.sol";
import "@celo-contracts/common/test/GetSetV1.sol";
import "@celo-contracts/common/test/HasInitializer.sol";
import "@celo-contracts/common/test/MsgSenderCheck.sol";

contract ProxyTest is Test, TestConstants, Utils {
contract ProxyTest is TestWithUtils {
Proxy proxy;
GetSetV0 getSet;
GetSetV0 proxiedGetSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ pragma solidity ^0.5.13;

import "@celo-contracts/governance/BlockchainParameters.sol";

import "celo-foundry/Test.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import { TestConstants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";

contract BlockchainParametersTest is Test, TestConstants, Utils {
contract BlockchainParametersTest is TestWithUtils {
uint256 constant gasLimit = 7000000;
uint256 constant gasForNonGoldCurrencies = 50000;
address nonOwner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { MockSortedOracles } from "@celo-contracts/stability/test/MockSortedOrac
import { MockStableToken } from "@celo-contracts/stability/test/MockStableToken.sol";
import { CeloTokenMock } from "@test-sol/unit/common/CeloTokenMock.sol";

import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";

contract EpochRewardsTest is Utils {
contract EpochRewardsTest is TestWithUtils {
uint256 constant targetVotingYieldParamsInitial = 0.00016e24; // 0.00016
uint256 constant targetVotingYieldParamsMax = 0.0005e24; // 0.0005
uint256 constant targetVotingYieldParamsAdjustmentFactor = 1127990000000000000; // 0.00000112799
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import { TestConstants } from "@test-sol/constants.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";

import "solidity-bytes-utils/contracts/BytesLib.sol";
Expand Down Expand Up @@ -59,7 +57,7 @@ contract GovernanceMock is Governance(true) {
}
}

contract GovernanceTest is Test, TestConstants, Utils {
contract GovernanceTest is TestWithUtils {
using FixidityLib for FixidityLib.Fraction;
using BytesLib for bytes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";
import { TestConstants } from "@test-sol/constants.sol";

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "@celo-contracts/common/FixidityLib.sol";
Expand All @@ -13,7 +12,7 @@ import "@celo-contracts/governance/test/MockValidators.sol";
import "@celo-contracts/governance/test/MockLockedGold.sol";
import "@celo-contracts/governance/DowntimeSlasher.sol";
import "@celo-contracts/governance/test/MockUsingPrecompiles.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

contract DowntimeSlasherMock is DowntimeSlasher(true), MockUsingPrecompiles, Test {
struct SlashParams {
Expand Down Expand Up @@ -77,7 +76,7 @@ contract DowntimeSlasherMock is DowntimeSlasher(true), MockUsingPrecompiles, Tes
}
}

contract DowntimeSlasherTest is Test, TestConstants, Utils {
contract DowntimeSlasherTest is TestWithUtils {
using FixidityLib for FixidityLib.Fraction;
using SafeMath for uint256;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma experimental ABIEncoderV2;

// This test file is in 0.5 although the contract is in 0.8

import "celo-foundry/Test.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
Expand All @@ -20,11 +19,11 @@ import "@celo-contracts/governance/test/MockLockedGold.sol";
import "@test-sol/unit/governance/validators/mocks/ValidatorsMockTunnel.sol";

import "@test-sol/utils/ECDSAHelper.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import "@test-sol/utils/WhenL2.sol";

contract ValidatorsTest is Test, Utils, ECDSAHelper {
contract ValidatorsTest is TestWithUtils, ECDSAHelper {
using FixidityLib for FixidityLib.Fraction;
using SafeMath for uint256;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "celo-foundry/Test.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import "@celo-contracts/common/FixidityLib.sol";
import "@celo-contracts/common/Registry.sol";
Expand All @@ -30,7 +29,7 @@ contract ElectionMock is Election(true) {
}
}

contract ElectionTest is Utils {
contract ElectionTest is TestWithUtils {
using FixidityLib for FixidityLib.Fraction;

Accounts accounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";

import "@celo-contracts/common/FixidityLib.sol";
Expand All @@ -18,7 +18,7 @@ import "@celo-contracts/governance/test/MockValidators.sol";

import { TestBlocker } from "@test-sol/unit/common/Blockable.t.sol";

contract LockedGoldTest is Utils {
contract LockedGoldTest is TestWithUtils {
using FixidityLib for FixidityLib.Fraction;

Accounts accounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import { Utils } from "@test-sol/utils.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";
import "@test-sol/utils/WhenL2.sol";
import { ECDSAHelper } from "@test-sol/utils/ECDSAHelper.sol";

Expand All @@ -23,7 +23,7 @@ import "@celo-contracts/governance/test/MockElection.sol";
import "@celo-contracts/governance/test/MockGovernance.sol";
import "@celo-contracts/governance/test/MockValidators.sol";

contract ReleaseGoldTest is Utils, ECDSAHelper {
contract ReleaseGoldTest is TestWithUtils, ECDSAHelper {
using FixidityLib for FixidityLib.Fraction;

Accounts accounts;
Expand Down
6 changes: 2 additions & 4 deletions packages/protocol/test-sol/unit/identity/Random.t.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.5.13;

import "celo-foundry/Test.sol";
import { Utils } from "@test-sol/utils.sol";
import { TestConstants } from "@test-sol/constants.sol";
import { TestWithUtils } from "@test-sol/TestWithUtils.sol";

import "@celo-contracts/identity/Random.sol";
import "@celo-contracts/identity/test/RandomTest.sol";

contract RandomTest_ is Test, TestConstants, IsL2Check, Utils {
contract RandomTest_ is TestWithUtils {
RandomTest random;

event RandomnessBlockRetentionWindowSet(uint256 value);
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/test-sol/utils/WhenL2.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;

import "@test-sol/utils.sol";
import "@test-sol/TestWithUtils.sol";

contract WhenL2 is Utils {
contract WhenL2 is TestWithUtils {
function setUp() public {
super.setUp();
whenL2WithEpochManagerInitialization();
Expand Down
Loading