From 54412c1a97548a8a2f918a1e6c819d3967d6b894 Mon Sep 17 00:00:00 2001 From: Martin Beierling-Mutz Date: Sun, 21 Aug 2022 18:42:22 +0200 Subject: [PATCH] Remove unnecessary changes --- packages/hardhat/test/ClaimCODE.test.ts | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/hardhat/test/ClaimCODE.test.ts b/packages/hardhat/test/ClaimCODE.test.ts index c7558f8..4863222 100644 --- a/packages/hardhat/test/ClaimCODE.test.ts +++ b/packages/hardhat/test/ClaimCODE.test.ts @@ -9,18 +9,6 @@ import MerkleGenerator from '../utils/merkleGenerator'; const TOKEN_DECIMALS = 18; const setup = deployments.createFixture(async () => { - const unnamedAccounts = await getUnnamedAccounts(); - - const airdrop = { - [unnamedAccounts[1]]: 100, - [unnamedAccounts[2]]: 200, - [unnamedAccounts[3]]: 300, - }; - console.log(airdrop); - - const generator = new MerkleGenerator(TOKEN_DECIMALS, airdrop); - const { merkleRoot, merkleTree } = await generator.process(); - await deployments.fixture(['ClaimCODE']); const merkleProofCf = await ethers.getContractFactory('MerkleProofWrapper'); @@ -35,6 +23,18 @@ const setup = deployments.createFixture(async () => { const mockERC721 = await mockERC721Cf.deploy(); await mockERC721.deployed(); + const unnamedAccounts = await getUnnamedAccounts(); + + const airdrop = { + [unnamedAccounts[1]]: 100, + [unnamedAccounts[2]]: 200, + [unnamedAccounts[3]]: 300, + }; + console.log(airdrop); + + const generator = new MerkleGenerator(TOKEN_DECIMALS, airdrop); + const { merkleRoot, merkleTree } = await generator.process(); + const CODE = await ethers.getContract('CODE'); const ClaimCODE = await ethers.getContract('ClaimCODE'); const users = await setupUsers(unnamedAccounts, { ClaimCODE }); @@ -80,7 +80,7 @@ describe('Claim CODE', function () { expect(treasury).to.equal(owner); }); - it('Deployment should revoke admin role of deployer & only leave only treasury as admin', async function () { + it('Deployment should revoke admin role of deployer & leave only treasury as admin', async function () { const { CODE } = await setup(); const { deployer, treasury } = await getNamedAccounts(); const adminRole = await CODE.DEFAULT_ADMIN_ROLE(); @@ -116,7 +116,7 @@ describe('Claim CODE', function () { }); it('can claim correct allocation amount only', async function () { - const { users, merkleProof, CODE, ClaimCODE, codeAdmin, merkleRoot, merkleTree } = await setup(); + const { users, merkleProof, merkleRoot, merkleTree, CODE, ClaimCODE, codeAdmin } = await setup(); // Get tokens for address correctly const correctFormattedAddress: string = ethers.utils.getAddress(users[1].address); @@ -183,7 +183,7 @@ describe('Claim CODE', function () { }); it('cannot claim if contract is paused', async function () { - const { users, merkleProof, CODE, ClaimCODE, treasuryOwnedClaimCODE, merkleRoot, merkleTree } = await setup(); + const { users, merkleRoot, merkleProof, merkleTree, CODE, ClaimCODE, treasuryOwnedClaimCODE } = await setup(); const userId = 2; const userAmount = 200;