Skip to content

Commit 4387c6c

Browse files
authored
test: wip refactor unit tests for staking fns (#1021)
* test: wip refactor unit tests for staking fns Signed-off-by: Tomás Migone <[email protected]> * test: refactor unstake tests passing Signed-off-by: Tomás Migone <[email protected]> * test: refactor withdraw tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor add to provision Signed-off-by: Tomás Migone <[email protected]> * test: wip thaw refactor Signed-off-by: Tomás Migone <[email protected]> * test: refactor thaw tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor deprovision test Signed-off-by: Tomás Migone <[email protected]> * test: refactor reprovision tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor provision parameters functions Signed-off-by: Tomás Migone <[email protected]> * test: refactor provision tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor operator tests Signed-off-by: Tomás Migone <[email protected]> * chore: update some configs Signed-off-by: Tomás Migone <[email protected]> * test: wip refactor of delegation tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor service provider tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor delegation tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor governance tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor ttools tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor slash test Signed-off-by: Tomás Migone <[email protected]> * test: refactor legacy allocation tests wip Signed-off-by: Tomás Migone <[email protected]> * test: refacto allocation close tests Signed-off-by: Tomás Migone <[email protected]> * test: refactor collect allocation tests Signed-off-by: Tomás Migone <[email protected]> * fix: remove comments Signed-off-by: Tomás Migone <[email protected]> * chore: use solidity 0.8.27, remove compilation via ir Signed-off-by: Tomás Migone <[email protected]> * chore: use solidity 0.8.27 Signed-off-by: Tomás Migone <[email protected]> --------- Signed-off-by: Tomás Migone <[email protected]>
1 parent 63d2ba4 commit 4387c6c

File tree

182 files changed

+2877
-1437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+2877
-1437
lines changed

packages/contracts/contracts/arbitrum/ITokenGateway.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
*/
2525

26-
pragma solidity ^0.7.6 || 0.8.26;
26+
pragma solidity ^0.7.6 || 0.8.27;
2727

2828
interface ITokenGateway {
2929
/// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated

packages/contracts/contracts/curation/ICuration.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
/**
66
* @title Curation Interface

packages/contracts/contracts/epochs/IEpochManager.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IEpochManager {
66
// -- Configuration --

packages/contracts/contracts/gateway/ICallhookReceiver.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* be allowlisted by the governor, but also implement this interface that contains
77
* the function that will actually be called by the L2GraphTokenGateway.
88
*/
9-
pragma solidity ^0.7.6 || 0.8.26;
9+
pragma solidity ^0.7.6 || 0.8.27;
1010

1111
interface ICallhookReceiver {
1212
/**

packages/contracts/contracts/governance/Controller.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { IController } from "./IController.sol";
66
import { IManaged } from "./IManaged.sol";

packages/contracts/contracts/governance/Governed.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
/**
66
* @title Graph Governance contract

packages/contracts/contracts/governance/IController.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IController {
66
function getGovernor() external view returns (address);

packages/contracts/contracts/governance/IManaged.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { IController } from "./IController.sol";
66

packages/contracts/contracts/governance/Pausable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
abstract contract Pausable {
66
/**

packages/contracts/contracts/l2/staking/IL2StakingBase.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { ICallhookReceiver } from "../../gateway/ICallhookReceiver.sol";
66

packages/contracts/contracts/l2/staking/IL2StakingTypes.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IL2StakingTypes {
66
/// @dev Message codes for the L1 -> L2 bridge callhook

packages/contracts/contracts/rewards/IRewardsIssuer.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IRewardsIssuer {
66
/**

packages/contracts/contracts/rewards/IRewardsManager.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IRewardsManager {
66
/**

packages/contracts/contracts/rewards/RewardsManagerStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import "./IRewardsManager.sol";
66
import "../governance/Managed.sol";

packages/contracts/contracts/token/IGraphToken.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
66

packages/contracts/contracts/upgrades/GraphProxy.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { GraphProxyStorage } from "./GraphProxyStorage.sol";
66

packages/contracts/contracts/upgrades/GraphProxyAdmin.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { Governed } from "../governance/Governed.sol";
66

packages/contracts/contracts/upgrades/GraphProxyStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
/**
66
* @title Graph Proxy Storage

packages/contracts/contracts/upgrades/GraphUpgradeable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import { IGraphProxy } from "./IGraphProxy.sol";
66

packages/contracts/contracts/upgrades/IGraphProxy.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
interface IGraphProxy {
66
function admin() external returns (address);

packages/contracts/contracts/utils/TokenUtils.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity ^0.7.6 || 0.8.26;
3+
pragma solidity ^0.7.6 || 0.8.27;
44

55
import "../token/IGraphToken.sol";
66

packages/horizon/contracts/data-service/DataService.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataService } from "./interfaces/IDataService.sol";
55

packages/horizon/contracts/data-service/DataServiceStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
abstract contract DataServiceV1Storage {
55
/// @dev Gap to allow adding variables in future upgrades

packages/horizon/contracts/data-service/extensions/DataServiceFees.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataServiceFees } from "../interfaces/IDataServiceFees.sol";
55

packages/horizon/contracts/data-service/extensions/DataServiceFeesStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataServiceFees } from "../interfaces/IDataServiceFees.sol";
55

packages/horizon/contracts/data-service/extensions/DataServicePausable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataServicePausable } from "../interfaces/IDataServicePausable.sol";
55

packages/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataServicePausable } from "../interfaces/IDataServicePausable.sol";
55

packages/horizon/contracts/data-service/extensions/DataServiceRescuable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
55
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

packages/horizon/contracts/data-service/interfaces/IDataService.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IGraphPayments } from "../../interfaces/IGraphPayments.sol";
55

packages/horizon/contracts/data-service/interfaces/IDataServiceFees.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataService } from "./IDataService.sol";
55

packages/horizon/contracts/data-service/interfaces/IDataServicePausable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataService } from "./IDataService.sol";
55

packages/horizon/contracts/data-service/interfaces/IDataServiceRescuable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IDataService } from "./IDataService.sol";
55

packages/horizon/contracts/data-service/libraries/ProvisionTracker.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IHorizonStaking } from "../../interfaces/IHorizonStaking.sol";
55

packages/horizon/contracts/data-service/utilities/ProvisionManager.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IHorizonStaking } from "../../interfaces/IHorizonStaking.sol";
55

packages/horizon/contracts/data-service/utilities/ProvisionManagerStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
/**
55
* @title Storage layout for the {ProvisionManager} helper contract.

packages/horizon/contracts/interfaces/IGraphPayments.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
/**
55
* @title Interface for the {GraphPayments} contract

packages/horizon/contracts/interfaces/IGraphProxyAdmin.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
/**
66
* @title IGraphProxyAdmin

packages/horizon/contracts/interfaces/IHorizonStaking.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
import { IHorizonStakingTypes } from "./internal/IHorizonStakingTypes.sol";
66
import { IHorizonStakingMain } from "./internal/IHorizonStakingMain.sol";

packages/horizon/contracts/interfaces/IPaymentsCollector.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
import { IGraphPayments } from "./IGraphPayments.sol";
66

packages/horizon/contracts/interfaces/IPaymentsEscrow.sol

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IGraphPayments } from "./IGraphPayments.sol";
55

@@ -84,12 +84,7 @@ interface IPaymentsEscrow {
8484
* @param tokens The amount of tokens being thawed
8585
* @param thawEndTimestamp The timestamp at which the thawing period ends
8686
*/
87-
event Thaw(
88-
address indexed payer,
89-
address indexed receiver,
90-
uint256 tokens,
91-
uint256 thawEndTimestamp
92-
);
87+
event Thaw(address indexed payer, address indexed receiver, uint256 tokens, uint256 thawEndTimestamp);
9388

9489
/**
9590
* @notice Emitted when a payer withdraws funds from the escrow for a payer-receiver pair

packages/horizon/contracts/interfaces/ITAPCollector.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
import { IPaymentsCollector } from "./IPaymentsCollector.sol";
55

packages/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
import { IHorizonStakingTypes } from "./IHorizonStakingTypes.sol";
66
import { IGraphPayments } from "../IGraphPayments.sol";

packages/horizon/contracts/interfaces/internal/IHorizonStakingExtension.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
import { IRewardsIssuer } from "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol";
66
import { IL2StakingBase } from "@graphprotocol/contracts/contracts/l2/staking/IL2StakingBase.sol";

packages/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
import { IGraphPayments } from "../../interfaces/IGraphPayments.sol";
66

packages/horizon/contracts/interfaces/internal/IHorizonStakingTypes.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
/* solhint-disable var-name-mixedcase */ // TODO: create custom var-name-mixedcase
66

packages/horizon/contracts/libraries/Denominations.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
/**
55
* @title Denominations library

packages/horizon/contracts/libraries/LibFixedMath.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// SPDX-License-Identifier: Apache-2.0
2020

21-
pragma solidity 0.8.26;
21+
pragma solidity 0.8.27;
2222

2323
// solhint-disable indent
2424
/// @dev Signed, fixed-point, 127-bit precision math library.

packages/horizon/contracts/libraries/LinkedList.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
/**
66
* @title LinkedList library

packages/horizon/contracts/libraries/MathUtils.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22

3-
pragma solidity 0.8.26;
3+
pragma solidity 0.8.27;
44

55
/**
66
* @title MathUtils Library

packages/horizon/contracts/libraries/PPMMath.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
pragma solidity 0.8.26;
2+
pragma solidity 0.8.27;
33

44
/**
55
* @title PPMMath library

0 commit comments

Comments
 (0)