Skip to content

Commit

Permalink
refactor: deploy subgraph in initial test
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Oct 11, 2023
1 parent 9dc1c76 commit 81d66ea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ hardhat.config.ts
typechain-types

/subgraphs/venus-governance/tests/integration/index.ts
/subgraphs/isolated-pools/tests/integration/index.ts
2 changes: 1 addition & 1 deletion subgraphs/isolated-pools/tests/integration/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// The first test must deploy the subgraph
import './setup';
import './pool.ts';
import './poolRegistry.ts';
import './vTokens.ts';
3 changes: 0 additions & 3 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 @@ -22,8 +21,6 @@ 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
18 changes: 18 additions & 0 deletions subgraphs/isolated-pools/tests/integration/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { deploy } from 'venus-subgraph-utils';

import { SUBGRAPH_ACCOUNT, SUBGRAPH_NAME, SYNC_DELAY } from './constants';

describe('Deploy Subgraph', function () {
it('should deploy subgraph', async function () {
this.timeout(500000); // sometimes it takes a long time
const root = `${__dirname}/../..`;

await deploy({
root,
packageName: 'isolated-pools-subgraph',
subgraphAccount: SUBGRAPH_ACCOUNT,
subgraphName: SUBGRAPH_NAME,
syncDelay: SYNC_DELAY,
});
});
});

0 comments on commit 81d66ea

Please sign in to comment.