Skip to content

Commit

Permalink
test: deploy subgraph once
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Sep 22, 2023
1 parent 3b85c8f commit fdf07c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions subgraphs/isolated-pools/tests/integration/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// The first test must deploy the subgraph
import './pool.ts';
import './poolRegistry.ts';
import './vTokens.ts';
3 changes: 1 addition & 2 deletions subgraphs/isolated-pools/tests/integration/poolRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');

Expand Down
10 changes: 6 additions & 4 deletions subgraphs/isolated-pools/tests/integration/vTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit fdf07c0

Please sign in to comment.