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

test: wip refactor unit tests for staking fns #1021

Merged
merged 24 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion packages/contracts/contracts/arbitrum/ITokenGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*/

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface ITokenGateway {
/// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/curation/ICuration.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

/**
* @title Curation Interface
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/epochs/IEpochManager.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IEpochManager {
// -- Configuration --
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/gateway/ICallhookReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* be allowlisted by the governor, but also implement this interface that contains
* the function that will actually be called by the L2GraphTokenGateway.
*/
pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface ICallhookReceiver {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Controller.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

import { IController } from "./IController.sol";
import { IManaged } from "./IManaged.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Governed.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

/**
* @title Graph Governance contract
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IController.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IController {
function getGovernor() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/IManaged.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/governance/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

abstract contract Pausable {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/l2/staking/IL2StakingBase.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IL2StakingTypes {
/// @dev Message codes for the L1 -> L2 bridge callhook
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/rewards/IRewardsIssuer.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IRewardsIssuer {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/rewards/IRewardsManager.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IRewardsManager {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

import "./IRewardsManager.sol";
import "../governance/Managed.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/token/IGraphToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/upgrades/GraphProxy.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/upgrades/GraphProxyAdmin.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

/**
* @title Graph Proxy Storage
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/upgrades/GraphUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/upgrades/IGraphProxy.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

interface IGraphProxy {
function admin() external returns (address);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/utils/TokenUtils.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.26;
pragma solidity ^0.7.6 || 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/data-service/DataService.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

abstract contract DataServiceV1Storage {
/// @dev Gap to allow adding variables in future upgrades
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title Storage layout for the {ProvisionManager} helper contract.
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/interfaces/IGraphPayments.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title Interface for the {GraphPayments} contract
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/interfaces/IGraphProxyAdmin.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title IGraphProxyAdmin
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/interfaces/IHorizonStaking.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

import { IHorizonStakingTypes } from "./internal/IHorizonStakingTypes.sol";
import { IHorizonStakingMain } from "./internal/IHorizonStakingMain.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
9 changes: 2 additions & 7 deletions packages/horizon/contracts/interfaces/IPaymentsEscrow.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down Expand Up @@ -84,12 +84,7 @@ interface IPaymentsEscrow {
* @param tokens The amount of tokens being thawed
* @param thawEndTimestamp The timestamp at which the thawing period ends
*/
event Thaw(
address indexed payer,
address indexed receiver,
uint256 tokens,
uint256 thawEndTimestamp
);
event Thaw(address indexed payer, address indexed receiver, uint256 tokens, uint256 thawEndTimestamp);

/**
* @notice Emitted when a payer withdraws funds from the escrow for a payer-receiver pair
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/interfaces/ITAPCollector.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

import { IHorizonStakingTypes } from "./IHorizonStakingTypes.sol";
import { IGraphPayments } from "../IGraphPayments.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

import { IRewardsIssuer } from "@graphprotocol/contracts/contracts/rewards/IRewardsIssuer.sol";
import { IL2StakingBase } from "@graphprotocol/contracts/contracts/l2/staking/IL2StakingBase.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/libraries/Denominations.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title Denominations library
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/libraries/LibFixedMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.26;
pragma solidity 0.8.27;

// solhint-disable indent
/// @dev Signed, fixed-point, 127-bit precision math library.
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/libraries/LinkedList.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title LinkedList library
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/libraries/MathUtils.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title MathUtils Library
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/libraries/PPMMath.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;
pragma solidity 0.8.27;

/**
* @title PPMMath library
Expand Down
Loading
Loading