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

Use relative paths for non-lib imports #1117

Merged
merged 8 commits into from
Jul 30, 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
2 changes: 1 addition & 1 deletion contracts/test/MockAssetId.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { AssetId } from "contracts/src/libraries/AssetId.sol";
import { AssetId } from "../src/libraries/AssetId.sol";

contract MockAssetId {
function encodeAssetId(
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/MockERC4626Hyperdrive.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { ERC4626Hyperdrive } from "contracts/src/instances/erc4626/ERC4626Hyperdrive.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { ERC4626Hyperdrive } from "../src/instances/erc4626/ERC4626Hyperdrive.sol";
import { IHyperdrive } from "../src/interfaces/IHyperdrive.sol";

// This contract stubs out the yield source implementations of `ERC4626Hyperdrive`
// so that we can test the `ERC4626Hyperdrive` contract in isolation.
Expand Down
24 changes: 12 additions & 12 deletions contracts/test/MockHyperdrive.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { Hyperdrive } from "contracts/src/external/Hyperdrive.sol";
import { HyperdriveTarget0 } from "contracts/src/external/HyperdriveTarget0.sol";
import { HyperdriveTarget1 } from "contracts/src/external/HyperdriveTarget1.sol";
import { HyperdriveTarget2 } from "contracts/src/external/HyperdriveTarget2.sol";
import { HyperdriveTarget3 } from "contracts/src/external/HyperdriveTarget3.sol";
import { HyperdriveTarget4 } from "contracts/src/external/HyperdriveTarget4.sol";
import { HyperdriveBase } from "contracts/src/internal/HyperdriveBase.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { ETH } from "contracts/src/libraries/Constants.sol";
import { FixedPointMath } from "contracts/src/libraries/FixedPointMath.sol";
import { ERC20Mintable } from "contracts/test/ERC20Mintable.sol";
import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol";
import { Hyperdrive } from "../src/external/Hyperdrive.sol";
import { HyperdriveTarget0 } from "../src/external/HyperdriveTarget0.sol";
import { HyperdriveTarget1 } from "../src/external/HyperdriveTarget1.sol";
import { HyperdriveTarget2 } from "../src/external/HyperdriveTarget2.sol";
import { HyperdriveTarget3 } from "../src/external/HyperdriveTarget3.sol";
import { HyperdriveTarget4 } from "../src/external/HyperdriveTarget4.sol";
import { HyperdriveBase } from "../src/internal/HyperdriveBase.sol";
import { IHyperdrive } from "../src/interfaces/IHyperdrive.sol";
import { ETH } from "../src/libraries/Constants.sol";
import { FixedPointMath } from "../src/libraries/FixedPointMath.sol";
import { ERC20Mintable } from "../test/ERC20Mintable.sol";
import { HyperdriveUtils } from "../../test/utils/HyperdriveUtils.sol";

interface IMockHyperdrive {
function accrue(uint256 time, int256 apr) external;
Expand Down
10 changes: 5 additions & 5 deletions contracts/test/MockHyperdriveDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { IERC20 } from "contracts/src/interfaces/IERC20.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { IHyperdriveDeployerCoordinator } from "contracts/src/interfaces/IHyperdriveDeployerCoordinator.sol";
import { IHyperdriveTargetDeployer } from "contracts/src/interfaces/IHyperdriveTargetDeployer.sol";
import { VERSION, NUM_TARGETS } from "contracts/src/libraries/Constants.sol";
import { IERC20 } from "../src/interfaces/IERC20.sol";
import { IHyperdrive } from "../src/interfaces/IHyperdrive.sol";
import { IHyperdriveDeployerCoordinator } from "../src/interfaces/IHyperdriveDeployerCoordinator.sol";
import { IHyperdriveTargetDeployer } from "../src/interfaces/IHyperdriveTargetDeployer.sol";
import { VERSION, NUM_TARGETS } from "../src/libraries/Constants.sol";
import { MockHyperdrive } from "./MockHyperdrive.sol";

contract MockHyperdriveDeployer is IHyperdriveDeployerCoordinator {
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/MockHyperdriveMath.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { HyperdriveMath } from "contracts/src/libraries/HyperdriveMath.sol";
import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol";
import { HyperdriveMath } from "../src/libraries/HyperdriveMath.sol";
import { HyperdriveUtils } from "../../test/utils/HyperdriveUtils.sol";

contract MockHyperdriveMath {
function calculateSpotAPR(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockLPMath.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { LPMath } from "contracts/src/libraries/LPMath.sol";
import { LPMath } from "../src/libraries/LPMath.sol";

contract MockLPMath {
function calculateInitialReserves(
Expand Down
2 changes: 1 addition & 1 deletion test/3rdPartyLibs/LogExpMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

pragma solidity 0.8.20;

import { BalancerErrors, _require } from "test/3rdPartyLibs/BalancerErrors.sol";
import { BalancerErrors, _require } from "./BalancerErrors.sol";

/* solhint-disable */

Expand Down
6 changes: 3 additions & 3 deletions test/combinatorial/MultiToken._transferFrom.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity 0.8.20;
import "forge-std/Test.sol";
import "forge-std/console2.sol";

import { ERC20ForwarderFactory } from "contracts/src/token/ERC20ForwarderFactory.sol";
import { IMockHyperdrive } from "contracts/test/MockHyperdrive.sol";
import { CombinatorialTest } from "test/utils/CombinatorialTest.sol";
import { ERC20ForwarderFactory } from "../../contracts/src/token/ERC20ForwarderFactory.sol";
import { IMockHyperdrive } from "../../contracts/test/MockHyperdrive.sol";
import { CombinatorialTest } from "../utils/CombinatorialTest.sol";

contract MultiToken__transferFrom is CombinatorialTest {
struct TestCase {
Expand Down
12 changes: 6 additions & 6 deletions test/debug/Debug.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
pragma solidity 0.8.20;

import { console2 as console } from "forge-std/console2.sol";
import { IHyperdriveCore } from "contracts/src/interfaces/IHyperdriveCore.sol";
import { IMultiTokenCore } from "contracts/src/interfaces/IMultiTokenCore.sol";
import { ETH } from "contracts/src/libraries/Constants.sol";
import { BaseTest } from "test/utils/BaseTest.sol";
import { EtchingUtils } from "test/utils/EtchingUtils.sol";
import { Lib } from "test/utils/Lib.sol";
import { IHyperdriveCore } from "../../contracts/src/interfaces/IHyperdriveCore.sol";
import { IMultiTokenCore } from "../../contracts/src/interfaces/IMultiTokenCore.sol";
import { ETH } from "../../contracts/src/libraries/Constants.sol";
import { BaseTest } from "../utils/BaseTest.sol";
import { EtchingUtils } from "../utils/EtchingUtils.sol";
import { Lib } from "../utils/Lib.sol";

/// @author DELV
/// @title Debugging
Expand Down
36 changes: 15 additions & 21 deletions test/instances/aave/AaveHyperdrive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@ pragma solidity 0.8.20;
import { IPool } from "aave/interfaces/IPool.sol";
import { DataTypes } from "aave/protocol/libraries/types/DataTypes.sol";
import { stdStorage, StdStorage } from "forge-std/Test.sol";
import { AaveHyperdriveCoreDeployer } from "contracts/src/deployers/aave/AaveHyperdriveCoreDeployer.sol";
import { AaveHyperdriveDeployerCoordinator } from "contracts/src/deployers/aave/AaveHyperdriveDeployerCoordinator.sol";
import { AaveTarget0Deployer } from "contracts/src/deployers/aave/AaveTarget0Deployer.sol";
import { AaveTarget1Deployer } from "contracts/src/deployers/aave/AaveTarget1Deployer.sol";
import { AaveTarget2Deployer } from "contracts/src/deployers/aave/AaveTarget2Deployer.sol";
import { AaveTarget3Deployer } from "contracts/src/deployers/aave/AaveTarget3Deployer.sol";
import { AaveTarget4Deployer } from "contracts/src/deployers/aave/AaveTarget4Deployer.sol";
import { HyperdriveFactory } from "contracts/src/factory/HyperdriveFactory.sol";
import { IAaveHyperdrive } from "contracts/src/interfaces/IAaveHyperdrive.sol";
import { IAToken } from "contracts/src/interfaces/IAToken.sol";
import { IERC20 } from "contracts/src/interfaces/IERC20.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { AssetId } from "contracts/src/libraries/AssetId.sol";
import { ETH } from "contracts/src/libraries/Constants.sol";
import { FixedPointMath, ONE } from "contracts/src/libraries/FixedPointMath.sol";
import { HyperdriveMath } from "contracts/src/libraries/HyperdriveMath.sol";
import { ERC20ForwarderFactory } from "contracts/src/token/ERC20ForwarderFactory.sol";
import { ERC20Mintable } from "contracts/test/ERC20Mintable.sol";
import { InstanceTest } from "test/utils/InstanceTest.sol";
import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol";
import { Lib } from "test/utils/Lib.sol";
import { AaveHyperdriveCoreDeployer } from "../../../contracts/src/deployers/aave/AaveHyperdriveCoreDeployer.sol";
import { AaveHyperdriveDeployerCoordinator } from "../../../contracts/src/deployers/aave/AaveHyperdriveDeployerCoordinator.sol";
import { AaveTarget0Deployer } from "../../../contracts/src/deployers/aave/AaveTarget0Deployer.sol";
import { AaveTarget1Deployer } from "../../../contracts/src/deployers/aave/AaveTarget1Deployer.sol";
import { AaveTarget2Deployer } from "../../../contracts/src/deployers/aave/AaveTarget2Deployer.sol";
import { AaveTarget3Deployer } from "../../../contracts/src/deployers/aave/AaveTarget3Deployer.sol";
import { AaveTarget4Deployer } from "../../../contracts/src/deployers/aave/AaveTarget4Deployer.sol";
import { IAToken } from "../../../contracts/src/interfaces/IAToken.sol";
import { IAaveHyperdrive } from "../../../contracts/src/interfaces/IAaveHyperdrive.sol";
import { IERC20 } from "../../../contracts/src/interfaces/IERC20.sol";
import { IHyperdrive } from "../../../contracts/src/interfaces/IHyperdrive.sol";
import { FixedPointMath } from "../../../contracts/src/libraries/FixedPointMath.sol";
import { InstanceTest } from "../../utils/InstanceTest.sol";
import { HyperdriveUtils } from "../../utils/HyperdriveUtils.sol";
import { Lib } from "../../utils/Lib.sol";

contract AaveHyperdriveTest is InstanceTest {
using FixedPointMath for uint256;
Expand Down
46 changes: 23 additions & 23 deletions test/instances/eeth/EETHHyperdrive.t.sol
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { ILiquidityPool } from "contracts/src/interfaces/ILiquidityPool.sol";
import { IEETH } from "contracts/src/interfaces/IEETH.sol";
import { EETHHyperdriveCoreDeployer } from "contracts/src/deployers/eeth/EETHHyperdriveCoreDeployer.sol";
import { EETHHyperdriveDeployerCoordinator } from "contracts/src/deployers/eeth/EETHHyperdriveDeployerCoordinator.sol";
import { EETHTarget0Deployer } from "contracts/src/deployers/eeth/EETHTarget0Deployer.sol";
import { EETHTarget1Deployer } from "contracts/src/deployers/eeth/EETHTarget1Deployer.sol";
import { EETHTarget2Deployer } from "contracts/src/deployers/eeth/EETHTarget2Deployer.sol";
import { EETHTarget3Deployer } from "contracts/src/deployers/eeth/EETHTarget3Deployer.sol";
import { EETHTarget4Deployer } from "contracts/src/deployers/eeth/EETHTarget4Deployer.sol";
import { HyperdriveFactory } from "contracts/src/factory/HyperdriveFactory.sol";
import { EETHConversions } from "contracts/src/instances/eeth/EETHConversions.sol";
import { IERC20 } from "contracts/src/interfaces/IERC20.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { IEETHHyperdrive } from "contracts/src/interfaces/IEETHHyperdrive.sol";
import { AssetId } from "contracts/src/libraries/AssetId.sol";
import { ETH } from "contracts/src/libraries/Constants.sol";
import { FixedPointMath, ONE } from "contracts/src/libraries/FixedPointMath.sol";
import { HyperdriveMath } from "contracts/src/libraries/HyperdriveMath.sol";
import { ERC20ForwarderFactory } from "contracts/src/token/ERC20ForwarderFactory.sol";
import { ERC20Mintable } from "contracts/test/ERC20Mintable.sol";
import { InstanceTest } from "test/utils/InstanceTest.sol";
import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol";
import { Lib } from "test/utils/Lib.sol";
import { ILiquidityPool } from "../../../contracts/src/interfaces/ILiquidityPool.sol";
import { IEETH } from "../../../contracts/src/interfaces/IEETH.sol";
import { EETHHyperdriveCoreDeployer } from "../../../contracts/src/deployers/eeth/EETHHyperdriveCoreDeployer.sol";
import { EETHHyperdriveDeployerCoordinator } from "../../../contracts/src/deployers/eeth/EETHHyperdriveDeployerCoordinator.sol";
import { EETHTarget0Deployer } from "../../../contracts/src/deployers/eeth/EETHTarget0Deployer.sol";
import { EETHTarget1Deployer } from "../../../contracts/src/deployers/eeth/EETHTarget1Deployer.sol";
import { EETHTarget2Deployer } from "../../../contracts/src/deployers/eeth/EETHTarget2Deployer.sol";
import { EETHTarget3Deployer } from "../../../contracts/src/deployers/eeth/EETHTarget3Deployer.sol";
import { EETHTarget4Deployer } from "../../../contracts/src/deployers/eeth/EETHTarget4Deployer.sol";
import { HyperdriveFactory } from "../../../contracts/src/factory/HyperdriveFactory.sol";
import { EETHConversions } from "../../../contracts/src/instances/eeth/EETHConversions.sol";
import { IERC20 } from "../../../contracts/src/interfaces/IERC20.sol";
import { IHyperdrive } from "../../../contracts/src/interfaces/IHyperdrive.sol";
import { IEETHHyperdrive } from "../../../contracts/src/interfaces/IEETHHyperdrive.sol";
import { AssetId } from "../../../contracts/src/libraries/AssetId.sol";
import { ETH } from "../../../contracts/src/libraries/Constants.sol";
import { FixedPointMath, ONE } from "../../../contracts/src/libraries/FixedPointMath.sol";
import { HyperdriveMath } from "../../../contracts/src/libraries/HyperdriveMath.sol";
import { ERC20ForwarderFactory } from "../../../contracts/src/token/ERC20ForwarderFactory.sol";
import { ERC20Mintable } from "../../../contracts/test/ERC20Mintable.sol";
import { InstanceTest } from "../../utils/InstanceTest.sol";
import { HyperdriveUtils } from "../../utils/HyperdriveUtils.sol";
import { Lib } from "../../utils/Lib.sol";

contract EETHHyperdriveTest is InstanceTest {
using FixedPointMath for uint256;
Expand Down
56 changes: 28 additions & 28 deletions test/instances/erc4626/ERC4626Hyperdrive.t.sol
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.20;

import { ERC4626HyperdriveCoreDeployer } from "contracts/src/deployers/erc4626/ERC4626HyperdriveCoreDeployer.sol";
import { ERC4626HyperdriveDeployerCoordinator } from "contracts/src/deployers/erc4626/ERC4626HyperdriveDeployerCoordinator.sol";
import { ERC4626Target0Deployer } from "contracts/src/deployers/erc4626/ERC4626Target0Deployer.sol";
import { ERC4626Target1Deployer } from "contracts/src/deployers/erc4626/ERC4626Target1Deployer.sol";
import { ERC4626Target2Deployer } from "contracts/src/deployers/erc4626/ERC4626Target2Deployer.sol";
import { ERC4626Target3Deployer } from "contracts/src/deployers/erc4626/ERC4626Target3Deployer.sol";
import { ERC4626Target4Deployer } from "contracts/src/deployers/erc4626/ERC4626Target4Deployer.sol";
import { HyperdriveFactory } from "contracts/src/factory/HyperdriveFactory.sol";
import { ERC4626Target0 } from "contracts/src/instances/erc4626/ERC4626Target0.sol";
import { ERC4626Target1 } from "contracts/src/instances/erc4626/ERC4626Target1.sol";
import { ERC4626Target2 } from "contracts/src/instances/erc4626/ERC4626Target2.sol";
import { ERC4626Target3 } from "contracts/src/instances/erc4626/ERC4626Target3.sol";
import { ERC4626Target4 } from "contracts/src/instances/erc4626/ERC4626Target4.sol";
import { IERC20 } from "contracts/src/interfaces/IERC20.sol";
import { IERC4626 } from "contracts/src/interfaces/IERC4626.sol";
import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol";
import { IHyperdriveDeployerCoordinator } from "contracts/src/interfaces/IHyperdriveDeployerCoordinator.sol";
import { AssetId } from "contracts/src/libraries/AssetId.sol";
import { ERC4626_HYPERDRIVE_KIND, ERC4626_HYPERDRIVE_DEPLOYER_COORDINATOR_KIND, VERSION } from "contracts/src/libraries/Constants.sol";
import { FixedPointMath, ONE } from "contracts/src/libraries/FixedPointMath.sol";
import { HyperdriveMath } from "contracts/src/libraries/HyperdriveMath.sol";
import { ERC20ForwarderFactory } from "contracts/src/token/ERC20ForwarderFactory.sol";
import { ERC20Mintable } from "contracts/test/ERC20Mintable.sol";
import { MockERC4626, ERC20 } from "contracts/test/MockERC4626.sol";
import { MockERC4626Hyperdrive } from "contracts/test/MockERC4626Hyperdrive.sol";
import { HyperdriveTest } from "test/utils/HyperdriveTest.sol";
import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol";
import { Lib } from "test/utils/Lib.sol";
import { ERC4626HyperdriveCoreDeployer } from "../../../contracts/src/deployers/erc4626/ERC4626HyperdriveCoreDeployer.sol";
import { ERC4626HyperdriveDeployerCoordinator } from "../../../contracts/src/deployers/erc4626/ERC4626HyperdriveDeployerCoordinator.sol";
import { ERC4626Target0Deployer } from "../../../contracts/src/deployers/erc4626/ERC4626Target0Deployer.sol";
import { ERC4626Target1Deployer } from "../../../contracts/src/deployers/erc4626/ERC4626Target1Deployer.sol";
import { ERC4626Target2Deployer } from "../../../contracts/src/deployers/erc4626/ERC4626Target2Deployer.sol";
import { ERC4626Target3Deployer } from "../../../contracts/src/deployers/erc4626/ERC4626Target3Deployer.sol";
import { ERC4626Target4Deployer } from "../../../contracts/src/deployers/erc4626/ERC4626Target4Deployer.sol";
import { HyperdriveFactory } from "../../../contracts/src/factory/HyperdriveFactory.sol";
import { ERC4626Target0 } from "../../../contracts/src/instances/erc4626/ERC4626Target0.sol";
import { ERC4626Target1 } from "../../../contracts/src/instances/erc4626/ERC4626Target1.sol";
import { ERC4626Target2 } from "../../../contracts/src/instances/erc4626/ERC4626Target2.sol";
import { ERC4626Target3 } from "../../../contracts/src/instances/erc4626/ERC4626Target3.sol";
import { ERC4626Target4 } from "../../../contracts/src/instances/erc4626/ERC4626Target4.sol";
import { IERC20 } from "../../../contracts/src/interfaces/IERC20.sol";
import { IERC4626 } from "../../../contracts/src/interfaces/IERC4626.sol";
import { IHyperdrive } from "../../../contracts/src/interfaces/IHyperdrive.sol";
import { IHyperdriveDeployerCoordinator } from "../../../contracts/src/interfaces/IHyperdriveDeployerCoordinator.sol";
import { AssetId } from "../../../contracts/src/libraries/AssetId.sol";
import { ERC4626_HYPERDRIVE_KIND, ERC4626_HYPERDRIVE_DEPLOYER_COORDINATOR_KIND, VERSION } from "../../../contracts/src/libraries/Constants.sol";
import { FixedPointMath, ONE } from "../../../contracts/src/libraries/FixedPointMath.sol";
import { HyperdriveMath } from "../../../contracts/src/libraries/HyperdriveMath.sol";
import { ERC20ForwarderFactory } from "../../../contracts/src/token/ERC20ForwarderFactory.sol";
import { ERC20Mintable } from "../../../contracts/test/ERC20Mintable.sol";
import { MockERC4626, ERC20 } from "../../../contracts/test/MockERC4626.sol";
import { MockERC4626Hyperdrive } from "../../../contracts/test/MockERC4626Hyperdrive.sol";
import { HyperdriveTest } from "../../utils/HyperdriveTest.sol";
import { HyperdriveUtils } from "../../utils/HyperdriveUtils.sol";
import { Lib } from "../../utils/Lib.sol";

contract ERC4626HyperdriveTest is HyperdriveTest {
using FixedPointMath for *;
Expand Down
Loading
Loading