From 85a26b4dae10a0d467bf8bcdcc4d67d45ec3df72 Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Wed, 20 Sep 2023 10:53:21 -0300 Subject: [PATCH] test: deploy subgraph once --- subgraphs/isolated-pools/tests/integration/index.ts | 1 + .../isolated-pools/tests/integration/poolRegistry.ts | 3 +-- subgraphs/isolated-pools/tests/integration/vTokens.ts | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/subgraphs/isolated-pools/tests/integration/index.ts b/subgraphs/isolated-pools/tests/integration/index.ts index 719a8ed2..4aa6ceb7 100644 --- a/subgraphs/isolated-pools/tests/integration/index.ts +++ b/subgraphs/isolated-pools/tests/integration/index.ts @@ -1,3 +1,4 @@ +// The first test must deploy the subgraph import './pool.ts'; import './poolRegistry.ts'; import './vTokens.ts'; diff --git a/subgraphs/isolated-pools/tests/integration/poolRegistry.ts b/subgraphs/isolated-pools/tests/integration/poolRegistry.ts index 9191e610..79ccfa9b 100644 --- a/subgraphs/isolated-pools/tests/integration/poolRegistry.ts +++ b/subgraphs/isolated-pools/tests/integration/poolRegistry.ts @@ -6,7 +6,6 @@ import { waitForSubgraphToBeSynced } from 'venus-subgraph-utils'; import subgraphClient from '../../subgraph-client'; import { defaultPools } from './constants'; -import deploy from './utils/deploy'; describe('Pool Registry', function () { let root: SignerWithAddress; @@ -21,7 +20,7 @@ describe('Pool Registry', function () { before(async function () { this.timeout(500000); // sometimes it takes a long time - await deploy(); + [root] = await ethers.getSigners(); poolRegistry = await ethers.getContract('PoolRegistry'); diff --git a/subgraphs/isolated-pools/tests/integration/vTokens.ts b/subgraphs/isolated-pools/tests/integration/vTokens.ts index caf3a593..e604ff14 100644 --- a/subgraphs/isolated-pools/tests/integration/vTokens.ts +++ b/subgraphs/isolated-pools/tests/integration/vTokens.ts @@ -5,7 +5,6 @@ import { ethers } from 'hardhat'; import { scaleValue, waitForSubgraphToBeSynced } from 'venus-subgraph-utils'; import subgraphClient from '../../subgraph-client'; -import deploy from './utils/deploy'; describe('VToken events', function () { const syncDelay = 2000; @@ -33,7 +32,6 @@ describe('VToken events', function () { before(async function () { this.timeout(500000); // sometimes it takes a long time - await deploy(); const signers = await ethers.getSigners(); [_root, liquidator, borrower, liquidator2, borrower2, supplier1, supplier2] = signers; @@ -83,7 +81,9 @@ describe('VToken events', function () { await bnxToken.connect(borrower).faucet(faucetAmount.times(2).toString()); await bnxToken.connect(borrower).approve(vBnxToken.address, faucetAmount.toString()); await bnxToken.connect(borrower2).faucet(borrowAmount.toString()); - const tx = await bnxToken.connect(borrower2).approve(vBnxToken.address, faucetAmount.toString()); + const tx = await bnxToken + .connect(borrower2) + .approve(vBnxToken.address, faucetAmount.toString()); await tx.wait(1); await waitForSubgraphToBeSynced(syncDelay); @@ -229,7 +229,9 @@ describe('VToken events', function () { await btcbToken.connect(liquidator2).approve(vBtcbToken.address, faucetAmount.toString()); const vTokenContract = await ethers.getContractAt('VToken', vBtcbAddress); - const tx = await vTokenContract.connect(liquidator2).addReserves(scaleValue(0.5, 18).toString()); + const tx = await vTokenContract + .connect(liquidator2) + .addReserves(scaleValue(0.5, 18).toString()); await tx.wait(1); await waitForSubgraphToBeSynced(syncDelay);