Skip to content

Commit

Permalink
fix: fix tests by updating core pool scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed May 10, 2024
1 parent 0a4ef70 commit bf2b99a
Show file tree
Hide file tree
Showing 21 changed files with 1,633 additions and 3,523 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
uses: actions/checkout@v2

- name: Start containers
run: docker-compose up -d
run: docker compose up -d

- name: Sleep to allow graph-node to become accessible
shell: bash
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Stop containers
if: always()
run: |
docker-compose down -v
docker compose down -v
docker system prune -f -a --volumes
integration-test-governance:
Expand All @@ -89,7 +89,7 @@ jobs:
uses: actions/checkout@v2

- name: Start containers
run: docker-compose up -d
run: docker compose up -d

- name: Sleep to allow graph-node to become accessible
shell: bash
Expand All @@ -111,5 +111,5 @@ jobs:
- name: Stop containers
if: always()
run: |
docker-compose down -v
docker compose down -v
docker system prune -f -a --volumes
8 changes: 5 additions & 3 deletions Dockerfile.hardhat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ RUN wget https://github.com/ethereum/solidity/releases/download/v0.6.6/solc-stat
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.13/solc-static-linux -O /usr/bin/solc-v0.8.13 && chmod +x /usr/bin/solc-v0.8.13

COPY package.json /usr/app/package.json
# COPY packages/utils/package.json /usr/app/packages/utils/package.json
# COPY subgraphs/isolated-pools/package.json /usr/app/subgraphs/isolated-pools/package.json
# COPY subgraphs/protocol-reserve/package.json /usr/app/subgraphs/protocol-reserve/package.json
# COPY subgraphs/venus/package.json /usr/app/subgraphs/venus/package.json
# COPY subgraphs/venus-governance/package.json /usr/app/subgraphs/venus-governance/package.json
COPY yarn.lock /usr/app/yarn.lock
COPY .yarn /usr/app/.yarn
COPY .yarnrc.yml /usr/app/.yarnrc.yml
Expand All @@ -18,7 +23,4 @@ WORKDIR /usr/app

RUN yarn

# Explicitly installing for hardhat
RUN yarn add ts-node --dev

EXPOSE 8545
5 changes: 3 additions & 2 deletions copy_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ rm ./contracts/oracle/contracts/ResilientOracle.sol

mkdir -p ./contracts/protocol
cp -rf ./node_modules/@venusprotocol/venus-protocol/contracts/ ./contracts/protocol/contracts
rm -rf contracts/protocol/contracts/test
rm -rf contracts/protocol/contracts/test/*
cp -p ./node_modules/@venusprotocol/venus-protocol/contracts/test/ComptrollerMock.sol ./contracts/protocol/contracts/test/ComptrollerMock.sol
cp -p ./node_modules/@venusprotocol/venus-protocol/contracts/test/MockToken.sol ./contracts/protocol/contracts/test/MockToken.sol

mkdir -p ./contracts/protocol-reserve
cp -rf ./node_modules/@venusprotocol/protocol-reserve/contracts/ ./contracts/protocol-reserve/contracts
Expand All @@ -31,7 +33,6 @@ cp -rf ./node_modules/@venusprotocol/governance-contracts/contracts/Governance .
rm ./contracts/governance/contracts/Governance/AccessControlManager.sol
rm ./contracts/governance/contracts/Governance/Timelock.sol

rm -rf contracts/protocol/contracts/Lens/VenusLens.sol

mkdir -p ./contracts/mocks
cp -rf ./mocks/ ./contracts/mocks/contracts
45 changes: 45 additions & 0 deletions deploy/000-core-pool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import deployLenses from '@venusprotocol/venus-protocol/dist/deploy/000-lenses';
import deployComptroller from '@venusprotocol/venus-protocol/dist/deploy/001-comptroller';
import deployInterestRateModel from '@venusprotocol/venus-protocol/dist/deploy/002-interest-rate-model';
import deployVBep20 from '@venusprotocol/venus-protocol/dist/deploy/003-deploy-VBep20';
import configureMarkets from '@venusprotocol/venus-protocol/dist/deploy/004-support-markets';
import deployVTreasuryV8 from '@venusprotocol/venus-protocol/dist/deploy/005-deploy-VTreasuryV8';
import deployPsm from '@venusprotocol/venus-protocol/dist/deploy/006-deploy-psm';
import deploySwaprouter from '@venusprotocol/venus-protocol/dist/deploy/006-deploy-swaprouter';
import deployLiquidator from '@venusprotocol/venus-protocol/dist/deploy/006-update-liquidator';
import deployVBNBAdmin from '@venusprotocol/venus-protocol/dist/deploy/007-deploy-VBNBAdmin';
import deployMockTokens from '@venusprotocol/venus-protocol/dist/deploy/007-deploy-mock-tokens';
import deployXvs from '@venusprotocol/venus-protocol/dist/deploy/007-deploy-xvs';
import deployVaults from '@venusprotocol/venus-protocol/dist/deploy/008-deploy-vaults';
import configureVaults from '@venusprotocol/venus-protocol/dist/deploy/009-configure-vaults';
import deployMarkets from '@venusprotocol/venus-protocol/dist/deploy/011-deploy-markets';
import deployPrime from '@venusprotocol/venus-protocol/dist/deploy/012-deploy-prime';
import deployConfigurePrime from '@venusprotocol/venus-protocol/dist/deploy/013-configure-prime';
import deployVaiController from '@venusprotocol/venus-protocol/dist/deploy/013-vai-controller-impl';
import deployTokenRedeemer from '@venusprotocol/venus-protocol/dist/deploy/014-deploy-token-redeemer';
import { DeployFunction } from 'hardhat-deploy/types';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
await deployLenses(hre);
await deployComptroller(hre);
await deployInterestRateModel(hre);
await deployVBep20(hre);
await configureMarkets(hre);
await deployVTreasuryV8(hre);
await deployPsm(hre);
await deploySwaprouter(hre);
await deployLiquidator(hre);
await deployMockTokens(hre);
await deployVBNBAdmin(hre);
await deployXvs(hre);
await deployVaults(hre);
await configureVaults(hre);
await deployMarkets(hre);
await deployPrime(hre);
await deployConfigurePrime(hre);
await deployVaiController(hre);
await deployTokenRedeemer(hre);
};

export default func;
File renamed without changes.
66 changes: 0 additions & 66 deletions deploy/017-vaults.ts

This file was deleted.

32 changes: 0 additions & 32 deletions deploy/019-configure-vaults.ts

This file was deleted.

7 changes: 3 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3'
services:
graph-node:
image: graphprotocol/graph-node:v0.32.0
image: graphprotocol/graph-node:v0.35.0
ports:
- 8000:8000
- 8001:8001
Expand Down Expand Up @@ -49,7 +48,7 @@ services:
healthcheck:
test: ["CMD", "node", "./hardhat-healthcheck.js"]
interval: 30s
timeout: 12s
timeout: 120s
retries: 10
ipfs:
image: ipfs/go-ipfs:v0.4.23
Expand All @@ -68,4 +67,4 @@ services:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
POSTGRES_INITDB_ARGS: '--encoding=UTF-8 --lc-collate=C --lc-ctype=C'
POSTGRES_INITDB_ARGS: '--encoding=UTF-8 --lc-collate=C --lc-ctype=C'
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'module-alias/register';
import '@nomicfoundation/hardhat-toolbox';
import 'hardhat-deploy';
import "@nomiclabs/hardhat-ethers";
import 'hardhat-dependency-compiler';
import { HardhatUserConfig } from 'hardhat/config';

Expand Down
26 changes: 0 additions & 26 deletions mocks/MockToken.sol

This file was deleted.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "https://github.com/VenusProtocol/subgraphs",
"license": "MIT",
"engines": {
"node": ">=16.x.x"
"node": ">=18.x.x"
},
"workspaces": [
"packages/*",
Expand All @@ -27,17 +27,15 @@
"lint:fix": "yarn lint --fix",
"pretty": "prettier '**/*.ts' --write",
"test": "yarn workspaces foreach run test",
"node:integration": "hardhat node --hostname 0.0.0.0",
"node:integration": "yarn hardhat node --hostname 0.0.0.0",
"test:integration": "yarn workspaces foreach run test:integration",
"postinstall": "patch-package && ./copy_contracts.sh"
"postinstall": "yarn patch-package && ./copy_contracts.sh"
},
"devDependencies": {
"@graphprotocol/client-cli": "^3.0.0",
"@graphprotocol/client-cli": "3.0.0",
"@graphprotocol/graph-cli": "^0.71.0",
"@graphprotocol/graph-ts": "^0.32.0",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomicfoundation/hardhat-network-helpers": "^1.0.4",
"@nomicfoundation/hardhat-toolbox": "^1.0.2",
"@nomiclabs/hardhat-ethers": "^2.1.1",
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
Expand All @@ -52,7 +50,7 @@
"@venusprotocol/isolated-pools": "3.2.0-dev.4",
"@venusprotocol/oracle": "2.2.0",
"@venusprotocol/protocol-reserve": "2.1.0",
"@venusprotocol/venus-protocol": "8.1.0",
"@venusprotocol/venus-protocol": "9.0.0-dev.6",
"assemblyscript": "0.19.23",
"chai": "^4.3.6",
"eslint": "^8.25.0",
Expand All @@ -61,7 +59,7 @@
"ethers": "^5.7.0",
"graphql": "16.6.0",
"graphql-tag": "2.12.6",
"hardhat": "^2.10.2",
"hardhat": "^2.16.1",
"hardhat-dependency-compiler": "^1.1.3",
"hardhat-deploy": "^0.11.15",
"hardhat-deploy-ethers": "^0.3.0-beta.13",
Expand All @@ -74,7 +72,6 @@
"patch-package": "6.5.1",
"prettier": "^2.5.1",
"prettier-airbnb-config": "^1.0.0",
"solidity-coverage": "^0.7.21",
"ts-node": "^10.9.1",
"typechain": "^8.1.0",
"typescript": "^4.8.4"
Expand Down
Loading

0 comments on commit bf2b99a

Please sign in to comment.