Skip to content

Commit

Permalink
test: fix unit test type import paths
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Jan 12, 2024
1 parent 4a89923 commit 516a813
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 102 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/test/e2e/scenarios/send-grt-to-l2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// npx hardhat e2e:scenario send-grt-to-l2 --network <network> --graph-config config/graph.<network>.yml

import hre from 'hardhat'
import { TASK_BRIDGE_TO_L2 } from '../../tasks/bridge/to-l2'
import { TASK_BRIDGE_TO_L2 } from '../../../tasks/bridge/to-l2'
import { getBridgeFixture } from './fixtures/bridge'
import { getGREOptsFromArgv } from '@graphprotocol/sdk/gre'
import { ethers } from 'ethers'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import hre from 'hardhat'
import { constants } from 'ethers'
import { expect } from 'chai'

import { DisputeManager } from '../../build/types/DisputeManager'
import { DisputeManager } from '../../../build/types/DisputeManager'

import { NetworkFixture } from '../lib/fixtures'
import { GraphNetworkContracts, toBN } from '@graphprotocol/sdk'
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts/test/unit/disputes/poi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { utils } from 'ethers'

import { DisputeManager } from '../../build/types/DisputeManager'
import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { IStaking } from '../../build/types/IStaking'
import { DisputeManager } from '../../../build/types/DisputeManager'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'

Expand Down
8 changes: 4 additions & 4 deletions packages/contracts/test/unit/disputes/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { expect } from 'chai'
import { constants } from 'ethers'
import { createAttestation, Receipt } from '@graphprotocol/common-ts'

import { DisputeManager } from '../../build/types/DisputeManager'
import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { IStaking } from '../../build/types/IStaking'
import { DisputeManager } from '../../../build/types/DisputeManager'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'

Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/unit/gateway/bridgeEscrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { BigNumber } from 'ethers'

import { GraphToken } from '../../build/types/GraphToken'
import { BridgeEscrow } from '../../build/types/BridgeEscrow'
import { GraphToken } from '../../../build/types/GraphToken'
import { BridgeEscrow } from '../../../build/types/BridgeEscrow'

import { NetworkFixture } from '../lib/fixtures'

Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/test/unit/gateway/l1GraphTokenGateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants, Signer, utils } from 'ethers'

import { GraphToken } from '../../build/types/GraphToken'
import { BridgeMock } from '../../build/types/BridgeMock'
import { InboxMock } from '../../build/types/InboxMock'
import { OutboxMock } from '../../build/types/OutboxMock'
import { L1GraphTokenGateway } from '../../build/types/L1GraphTokenGateway'
import { GraphToken } from '../../../build/types/GraphToken'
import { BridgeMock } from '../../../build/types/BridgeMock'
import { InboxMock } from '../../../build/types/InboxMock'
import { OutboxMock } from '../../../build/types/OutboxMock'
import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway'

import { NetworkFixture, ArbitrumL1Mocks, L1FixtureContracts } from '../lib/fixtures'

import { BridgeEscrow } from '../../build/types/BridgeEscrow'
import { BridgeEscrow } from '../../../build/types/BridgeEscrow'
import { helpers, applyL1ToL2Alias, toBN, toGRT, GraphNetworkContracts } from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/unit/governance/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants, utils } from 'ethers'

import { Controller } from '../../build/types/Controller'
import { EpochManager } from '../../build/types/EpochManager'
import { Controller } from '../../../build/types/Controller'
import { EpochManager } from '../../../build/types/EpochManager'

import { NetworkFixture } from '../lib/fixtures'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/unit/governance/governed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import hre from 'hardhat'
import '@nomiclabs/hardhat-ethers'

import { Governed } from '../../build/types/Governed'
import { Governed } from '../../../build/types/Governed'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

const { ethers } = hre
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/unit/governance/pausing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants } from 'ethers'

import { Controller } from '../../build/types/Controller'
import { IStaking } from '../../build/types/IStaking'
import { Controller } from '../../../build/types/Controller'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'
import { GraphNetworkContracts, toGRT } from '@graphprotocol/sdk'
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts/test/unit/l2/l2Curation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { utils, BigNumber, Event, Signer, constants } from 'ethers'

import { L2Curation } from '../../build/types/L2Curation'
import { GraphToken } from '../../build/types/GraphToken'
import { Controller } from '../../build/types/Controller'
import { L2Curation } from '../../../build/types/L2Curation'
import { GraphToken } from '../../../build/types/GraphToken'
import { Controller } from '../../../build/types/Controller'

import { NetworkFixture } from '../lib/fixtures'
import { GNS } from '../../build/types/GNS'
import { GNS } from '../../../build/types/GNS'
import { parseEther } from 'ethers/lib/utils'
import {
formatGRT,
Expand Down
10 changes: 5 additions & 5 deletions packages/contracts/test/unit/l2/l2GNS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { defaultAbiCoder, parseEther } from 'ethers/lib/utils'

import { L2FixtureContracts, NetworkFixture } from '../lib/fixtures'

import { L2GNS } from '../../build/types/L2GNS'
import { L2GraphTokenGateway } from '../../build/types/L2GraphTokenGateway'
import { L2GNS } from '../../../build/types/L2GNS'
import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway'
import {
burnSignal,
DEFAULT_RESERVE_RATIO,
Expand All @@ -15,8 +15,8 @@ import {
publishNewSubgraph,
publishNewVersion,
} from '../lib/gnsUtils'
import { L2Curation } from '../../build/types/L2Curation'
import { GraphToken } from '../../build/types/GraphToken'
import { L2Curation } from '../../../build/types/L2Curation'
import { GraphToken } from '../../../build/types/GraphToken'
import {
buildSubgraph,
buildSubgraphId,
Expand All @@ -30,7 +30,7 @@ import {
toGRT,
} from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { IL2Staking } from '../../build/types/IL2Staking'
import { IL2Staking } from '../../../build/types/IL2Staking'

const { HashZero } = ethers.constants

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/unit/l2/l2GraphToken.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hre from 'hardhat'
import { expect } from 'chai'

import { L2GraphToken } from '../../build/types/L2GraphToken'
import { L2GraphToken } from '../../../build/types/L2GraphToken'

import { grtTests } from '../lib/graphTokenTests'
import { NetworkFixture } from '../lib/fixtures'
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts/test/unit/l2/l2GraphTokenGateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import hre from 'hardhat'
import { expect, use } from 'chai'
import { constants, ContractTransaction, Signer, utils } from 'ethers'

import { L2GraphToken } from '../../build/types/L2GraphToken'
import { L2GraphTokenGateway } from '../../build/types/L2GraphTokenGateway'
import { CallhookReceiverMock } from '../../build/types/CallhookReceiverMock'
import { L2GraphToken } from '../../../build/types/L2GraphToken'
import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway'
import { CallhookReceiverMock } from '../../../build/types/CallhookReceiverMock'

import { L2FixtureContracts, NetworkFixture } from '../lib/fixtures'

import { FakeContract, smock } from '@defi-wonderland/smock'

use(smock.matchers)

import { RewardsManager } from '../../build/types/RewardsManager'
import { RewardsManager } from '../../../build/types/RewardsManager'
import { DeployType, GraphNetworkContracts, deploy, helpers, toBN, toGRT } from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/test/unit/l2/l2Staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { defaultAbiCoder, parseEther } from 'ethers/lib/utils'

import { NetworkFixture } from '../lib/fixtures'

import { IL2Staking } from '../../build/types/IL2Staking'
import { L2GraphTokenGateway } from '../../build/types/L2GraphTokenGateway'
import { GraphToken } from '../../build/types/GraphToken'
import { IL2Staking } from '../../../build/types/IL2Staking'
import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway'
import { GraphToken } from '../../../build/types/GraphToken'
import {
GraphNetworkContracts,
deriveChannelKey,
Expand Down
42 changes: 21 additions & 21 deletions packages/contracts/test/unit/lib/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Signer, providers } from 'ethers'

import { BridgeMock } from '../../build/types/BridgeMock'
import { InboxMock } from '../../build/types/InboxMock'
import { OutboxMock } from '../../build/types/OutboxMock'
import { Controller } from '../../build/types/Controller'
import { DisputeManager } from '../../build/types/DisputeManager'
import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { Curation } from '../../build/types/Curation'
import { L2Curation } from '../../build/types/L2Curation'
import { L1GNS } from '../../build/types/L1GNS'
import { L2GNS } from '../../build/types/L2GNS'
import { IL1Staking } from '../../build/types/IL1Staking'
import { IL2Staking } from '../../build/types/IL2Staking'
import { RewardsManager } from '../../build/types/RewardsManager'
import { ServiceRegistry } from '../../build/types/ServiceRegistry'
import { GraphProxyAdmin } from '../../build/types/GraphProxyAdmin'
import { L1GraphTokenGateway } from '../../build/types/L1GraphTokenGateway'
import { BridgeEscrow } from '../../build/types/BridgeEscrow'
import { L2GraphTokenGateway } from '../../build/types/L2GraphTokenGateway'
import { L2GraphToken } from '../../build/types/L2GraphToken'
import { LibExponential } from '../../build/types/LibExponential'
import { BridgeMock } from '../../../build/types/BridgeMock'
import { InboxMock } from '../../../build/types/InboxMock'
import { OutboxMock } from '../../../build/types/OutboxMock'
import { Controller } from '../../../build/types/Controller'
import { DisputeManager } from '../../../build/types/DisputeManager'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { Curation } from '../../../build/types/Curation'
import { L2Curation } from '../../../build/types/L2Curation'
import { L1GNS } from '../../../build/types/L1GNS'
import { L2GNS } from '../../../build/types/L2GNS'
import { IL1Staking } from '../../../build/types/IL1Staking'
import { IL2Staking } from '../../../build/types/IL2Staking'
import { RewardsManager } from '../../../build/types/RewardsManager'
import { ServiceRegistry } from '../../../build/types/ServiceRegistry'
import { GraphProxyAdmin } from '../../../build/types/GraphProxyAdmin'
import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway'
import { BridgeEscrow } from '../../../build/types/BridgeEscrow'
import { L2GraphTokenGateway } from '../../../build/types/L2GraphTokenGateway'
import { L2GraphToken } from '../../../build/types/L2GraphToken'
import { LibExponential } from '../../../build/types/LibExponential'
import {
DeployType,
GraphNetworkContracts,
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/test/unit/lib/gnsUtils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { BigNumber, ContractTransaction } from 'ethers'
import { namehash } from 'ethers/lib/utils'
import { Curation } from '../../build/types/Curation'
import { L1GNS } from '../../build/types/L1GNS'
import { L2GNS } from '../../build/types/L2GNS'
import { Curation } from '../../../build/types/Curation'
import { L1GNS } from '../../../build/types/L1GNS'
import { L2GNS } from '../../../build/types/L2GNS'
import { expect } from 'chai'
import { L2Curation } from '../../build/types/L2Curation'
import { GraphToken } from '../../build/types/GraphToken'
import { L2GraphToken } from '../../build/types/L2GraphToken'
import { L2Curation } from '../../../build/types/L2Curation'
import { GraphToken } from '../../../build/types/GraphToken'
import { L2GraphToken } from '../../../build/types/L2GraphToken'
import { PublishSubgraph, Subgraph, buildSubgraphId, toBN } from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/unit/lib/graphTokenTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants, BigNumber, Signature, ethers, Wallet } from 'ethers'

import { L2GraphToken } from '../../build/types/L2GraphToken'
import { GraphToken } from '../../build/types/GraphToken'
import { L2GraphToken } from '../../../build/types/L2GraphToken'
import { GraphToken } from '../../../build/types/GraphToken'
import { toBN, toGRT, helpers, Permit, signPermit, GraphNetworkContracts } from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { NetworkFixture } from './fixtures'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { BigNumber, constants, Wallet } from 'ethers'

import { AllocationExchange } from '../../build/types/AllocationExchange'
import { GraphToken } from '../../build/types/GraphToken'
import { IStaking } from '../../build/types/IStaking'
import { AllocationExchange } from '../../../build/types/AllocationExchange'
import { GraphToken } from '../../../build/types/GraphToken'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'
import { arrayify, joinSignature, SigningKey, solidityKeccak256 } from 'ethers/lib/utils'
Expand All @@ -17,7 +17,7 @@ import {
toGRT,
} from '@graphprotocol/sdk'
import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { EpochManager } from '../../build/types/EpochManager'
import { EpochManager } from '../../../build/types/EpochManager'

const { AddressZero, MaxUint256 } = constants

Expand Down
10 changes: 5 additions & 5 deletions packages/contracts/test/unit/rewards/rewards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { BigNumber as BN } from 'bignumber.js'

import { NetworkFixture } from '../lib/fixtures'

import { Curation } from '../../build/types/Curation'
import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { RewardsManager } from '../../build/types/RewardsManager'
import { IStaking } from '../../build/types/IStaking'
import { Curation } from '../../../build/types/Curation'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { RewardsManager } from '../../../build/types/RewardsManager'
import { IStaking } from '../../../build/types/IStaking'

import {
helpers,
Expand Down
10 changes: 5 additions & 5 deletions packages/contracts/test/unit/staking/allocation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants, BigNumber, PopulatedTransaction, Contract } from 'ethers'

import { Curation } from '../../build/types/Curation'
import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { IStaking } from '../../build/types/IStaking'
import { LibExponential } from '../../build/types/LibExponential'
import { Curation } from '../../../build/types/Curation'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { IStaking } from '../../../build/types/IStaking'
import { LibExponential } from '../../../build/types/LibExponential'

import { NetworkFixture } from '../lib/fixtures'
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/unit/staking/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { expect } from 'chai'
import { ethers } from 'hardhat'
import { constants } from 'ethers'

import { IStaking } from '../../build/types/IStaking'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'
import { GraphProxyAdmin } from '../../build/types/GraphProxyAdmin'
import { GraphProxyAdmin } from '../../../build/types/GraphProxyAdmin'
import { DeployType, GraphNetworkContracts, deploy, toBN, toGRT } from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/test/unit/staking/delegation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import hre from 'hardhat'
import { expect } from 'chai'
import { constants, BigNumber } from 'ethers'

import { EpochManager } from '../../build/types/EpochManager'
import { GraphToken } from '../../build/types/GraphToken'
import { IStaking } from '../../build/types/IStaking'
import { EpochManager } from '../../../build/types/EpochManager'
import { GraphToken } from '../../../build/types/GraphToken'
import { IStaking } from '../../../build/types/IStaking'

import { NetworkFixture } from '../lib/fixtures'
import {
Expand Down
13 changes: 6 additions & 7 deletions packages/contracts/test/unit/staking/l2Transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { expect } from 'chai'
import { constants, BigNumber } from 'ethers'
import { defaultAbiCoder, parseEther } from 'ethers/lib/utils'

import { GraphToken } from '../../build/types/GraphToken'
import { IL1Staking } from '../../build/types/IL1Staking'
import { IController } from '../../build/types/IController'
import { L1GraphTokenGateway } from '../../build/types/L1GraphTokenGateway'
import { L1GraphTokenLockTransferToolMock } from '../../build/types/L1GraphTokenLockTransferToolMock'
import { L1GraphTokenLockTransferToolBadMock } from '../../build/types/L1GraphTokenLockTransferToolBadMock'
import { GraphToken } from '../../../build/types/GraphToken'
import { IL1Staking } from '../../../build/types/IL1Staking'
import { IController } from '../../../build/types/IController'
import { L1GraphTokenGateway } from '../../../build/types/L1GraphTokenGateway'
import { L1GraphTokenLockTransferToolMock } from '../../../build/types/L1GraphTokenLockTransferToolMock'
import { L1GraphTokenLockTransferToolBadMock } from '../../../build/types/L1GraphTokenLockTransferToolBadMock'

import { ArbitrumL1Mocks, NetworkFixture } from '../lib/fixtures'

Expand All @@ -23,7 +23,6 @@ import {
toGRT,
} from '@graphprotocol/sdk'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { IStaking } from '../../build/types/IStaking'

const { AddressZero } = constants

Expand Down
Loading

0 comments on commit 516a813

Please sign in to comment.