From e4e73a57b78612cebbcc11e90602ca15767f2c5b Mon Sep 17 00:00:00 2001 From: nksazonov Date: Fri, 14 Oct 2022 17:46:04 +0300 Subject: [PATCH] fix tests imports --- test/clearing/src/participantData.ts | 2 +- test/vault/VaultUpgradability.spec.ts | 11 +++++------ test/vault/src/payload.ts | 2 +- test/vault/src/transactions.ts | 2 +- test/yellow/Yellow.spec.ts | 24 +++++++++++++----------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/test/clearing/src/participantData.ts b/test/clearing/src/participantData.ts index ee9fb12..32e80b3 100644 --- a/test/clearing/src/participantData.ts +++ b/test/clearing/src/participantData.ts @@ -1,7 +1,7 @@ import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {BigNumber} from 'ethers'; -import {YellowClearingBase} from '../../../../typechain'; +import {YellowClearingBase} from '../../../typechain'; export enum Status { None, diff --git a/test/vault/VaultUpgradability.spec.ts b/test/vault/VaultUpgradability.spec.ts index 57af939..96268e1 100644 --- a/test/vault/VaultUpgradability.spec.ts +++ b/test/vault/VaultUpgradability.spec.ts @@ -3,10 +3,9 @@ import {Contract, Wallet} from 'ethers'; import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {ethers} from 'hardhat'; -import TESTVaultUpgradability1Artifact from '../../artifacts/contracts/yellow/test/TESTVaultUpgradability1.sol/TESTVaultUpgradability1.json'; -import TESTVaultUpgradability2Artifact from '../../artifacts/contracts/yellow/test/TESTVaultUpgradability2.sol/TESTVaultUpgradability2.json'; -import TESTVaultUpgradability3Artifact from '../../artifacts/contracts/yellow/test/TESTVaultUpgradability3.sol/TESTVaultUpgradability3.json'; - +import TESTVaultUpgradability1Artifact from '../../artifacts/contracts/vault/test/TESTVaultUpgradability1.sol/TESTVaultUpgradability1.json'; +import TESTVaultUpgradability2Artifact from '../../artifacts/contracts/vault/test/TESTVaultUpgradability2.sol/TESTVaultUpgradability2.json'; +import TESTVaultUpgradability3Artifact from '../../artifacts/contracts/vault/test/TESTVaultUpgradability3.sol/TESTVaultUpgradability3.json'; import { ALREADY_INITIALIZED, ALREADY_MIGRATED, @@ -18,8 +17,8 @@ import { NOT_MAINTAINER, INVALID_NEXT_IMPL, ACCOUNT_MISSING_ROLE, -} from './src/revert-reasons'; -import {NEXT_IMPL_SET, ROLE_GRANTED, UPGRADED} from './src/event-names'; +} from '../../src/revert-reasons'; +import {NEXT_IMPL_SET, ROLE_GRANTED, UPGRADED} from '../../src/event-names'; const AddressZero = ethers.constants.AddressZero; const ADM_ROLE = ethers.constants.HashZero; diff --git a/test/vault/src/payload.ts b/test/vault/src/payload.ts index 398fcfe..ec92b03 100644 --- a/test/vault/src/payload.ts +++ b/test/vault/src/payload.ts @@ -3,7 +3,7 @@ import {utils} from 'ethers'; import {ParamType} from 'ethers/lib/utils'; import {ethers} from 'hardhat'; -import {signEncoded} from '../signatures'; +import {signEncoded} from '../../../src/signatures'; // keccak256('YELLOW_VAULT_DEPOSIT_ACTION'); export const DEPOSIT_ACTION = '0xa2d4613c2e2e0782566f63085acedcb19fbd37900464a8316040997ccd6e9fea'; diff --git a/test/vault/src/transactions.ts b/test/vault/src/transactions.ts index 9104632..d79760f 100644 --- a/test/vault/src/transactions.ts +++ b/test/vault/src/transactions.ts @@ -1,7 +1,7 @@ import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {utils, Signer} from 'ethers'; -import {signEncoded} from '../signatures'; +import {signEncoded} from '../../../src/signatures'; import { PartialPayload, diff --git a/test/yellow/Yellow.spec.ts b/test/yellow/Yellow.spec.ts index 97c80fb..06c840b 100644 --- a/test/yellow/Yellow.spec.ts +++ b/test/yellow/Yellow.spec.ts @@ -109,19 +109,21 @@ describe('Yellow Contract', function () { expect(await yellowContract.balanceOf(user.address)).to.equal(initialAmount.sub(burnAmount)); // burnFrom - await expect(yellowContract.connect(someone).burnFrom(user.address, burnAmount)).to.be.revertedWith( - insufficientAllowanceError() - ); - expect(await yellowContract.connect(user).approve(someone.address, burnAmount)).to.not.be.undefined; - expect(await yellowContract.connect(someone).burnFrom(user.address, burnAmount)).to.not.be.undefined; - await expect(yellowContract.connect(someone).burnFrom(user.address, burnAmount)).to.be.revertedWith( - insufficientAllowanceError() - ); + await expect( + yellowContract.connect(someone).burnFrom(user.address, burnAmount) + ).to.be.revertedWith(insufficientAllowanceError()); + expect(await yellowContract.connect(user).approve(someone.address, burnAmount)).to.not.be + .undefined; + expect(await yellowContract.connect(someone).burnFrom(user.address, burnAmount)).to.not.be + .undefined; + await expect( + yellowContract.connect(someone).burnFrom(user.address, burnAmount) + ).to.be.revertedWith(insufficientAllowanceError()); expect(await yellowContract.balanceOf(user.address)).to.equal( initialAmount.sub(burnAmount).sub(burnAmount) ); - await expect(yellowContract.connect(user).burnFrom(user.address, burnAmount)).to.be.revertedWith( - insufficientAllowanceError() - ); + await expect( + yellowContract.connect(user).burnFrom(user.address, burnAmount) + ).to.be.revertedWith(insufficientAllowanceError()); }); });