diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3d9d9c90..afc4e6ee 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,7 +61,7 @@ jobs: shell: bash run: sleep 45s - - name: Generate graphql types + - name: Generate Isolated Pools graphql types run: | docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run prepare:docker docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run codegen @@ -70,10 +70,23 @@ jobs: sleep 5s docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run generate-subgraph-types - - name: Run integration tests + - name: Run Isolated Pools integration integration tests run: | docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run test:integration + - name: Generate Governance graphql types + run: | + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run prepare:docker + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run codegen + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run create:docker + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run deploy:docker + sleep 5s + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run generate-subgraph-types + + - name: Run Governance integration integration tests + run: | + docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run test:integration + - name: Stop containers if: always() run: | diff --git a/subgraphs/venus-governance/config/local.json b/subgraphs/venus-governance/config/local.json index 0b433705..16d581f7 100644 --- a/subgraphs/venus-governance/config/local.json +++ b/subgraphs/venus-governance/config/local.json @@ -1,5 +1,5 @@ { - "network": "bsc", + "network": "hardhat", "accessControlManagerAddress": "0xc5a5C42992dECbae36851359345FE25997F5C42d", "accessControlManagerStartBlock": "0", "governorAlphaAddress": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", diff --git a/subgraphs/venus-governance/package.json b/subgraphs/venus-governance/package.json index c938be6f..2f7553c5 100644 --- a/subgraphs/venus-governance/package.json +++ b/subgraphs/venus-governance/package.json @@ -1,5 +1,5 @@ { - "name": "venus-governance", + "name": "venus-governance-subgraph", "version": "0.0.0", "license": "MIT", "repository": { @@ -12,10 +12,13 @@ "scripts": { "codegen": "graph codegen", "create:local": "graph create venusprotocol/venus-governance --node http://127.0.0.1:8020", + "create:docker": "npx graph create venusprotocol/venus-governance --node http://graph-node:8020/", + "build:docker": "npx graph build --ipfs http://ipfs:5001", "build:local": "graph build --ipfs http://localhost:5001", "build:mainnet": "graph build --ipfs https://api.thegraph.com/ipfs/ ", "deploy:integration": "graph deploy venusprotocol/venus-governance --debug --ipfs http://localhost:5001 --node http://127.0.0.1:8020/", "deploy:local": "npx mustache config/local.json template.yaml > subgraph.yaml && yarn deploy:integration", + "deploy:docker": "npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-governance --ipfs http://ipfs:5001 --node http://graph-node:8020/ --version-label ci", "deploy:testnet": "npx mustache config/testnet.json template.yaml > subgraph.yaml && graph deploy venusprotocol/venus-governance-chapel --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/", "deploy:mainnet": "npx mustache config/mainnet.json template.yaml > subgraph.yaml && graph deploy venusprotocol/venus-governance --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/", "prepare:local": "npx mustache config/local.json template.yaml > subgraph.yaml", diff --git a/subgraphs/venus-governance/src/mappings/bravo.ts b/subgraphs/venus-governance/src/mappings/bravo.ts index 062745d5..7891be93 100644 --- a/subgraphs/venus-governance/src/mappings/bravo.ts +++ b/subgraphs/venus-governance/src/mappings/bravo.ts @@ -50,7 +50,7 @@ export function handleProposalExecuted(event: ProposalExecuted): void { updateProposalExecuted(event); } -export function handleVoteCast(event: VoteCast): void { +export function handleBravoVoteCast(event: VoteCast): void { createVoteBravo(event); const proposalId = event.params.proposalId.toString(); const proposal = getProposal(proposalId); diff --git a/subgraphs/venus-governance/subgraph-client/.graphclientrc.yml b/subgraphs/venus-governance/subgraph-client/.graphclientrc.yml index 0986405f..543a58b8 100644 --- a/subgraphs/venus-governance/subgraph-client/.graphclientrc.yml +++ b/subgraphs/venus-governance/subgraph-client/.graphclientrc.yml @@ -2,7 +2,7 @@ sources: - name: venus-governance handler: graphql: - endpoint: http://127.0.0.1:8000/subgraphs/name/venusprotocol/venus-governance + endpoint: http://graph-node:8000/subgraphs/name/venusprotocol/venus-governance documents: - '../**/*.graphql' diff --git a/yarn.lock b/yarn.lock index 13567fa5..93f243fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16881,9 +16881,9 @@ __metadata: languageName: unknown linkType: soft -"venus-governance@workspace:subgraphs/venus-governance": +"venus-governance-subgraph@workspace:subgraphs/venus-governance": version: 0.0.0-use.local - resolution: "venus-governance@workspace:subgraphs/venus-governance" + resolution: "venus-governance-subgraph@workspace:subgraphs/venus-governance" dependencies: "@graphprotocol/client-cli": ^3.0.0 apollo-fetch: ^0.7.0