Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
fix tests imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nksazonov committed Oct 14, 2022
1 parent 5d8985c commit e4e73a5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/clearing/src/participantData.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
11 changes: 5 additions & 6 deletions test/vault/VaultUpgradability.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/vault/src/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/vault/src/transactions.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
24 changes: 13 additions & 11 deletions test/yellow/Yellow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
});

0 comments on commit e4e73a5

Please sign in to comment.