From 0f366d28b95ad1d25c1e351922b0ea82e9437320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Wed, 14 Aug 2024 15:42:36 -0300 Subject: [PATCH 1/4] fix: update subgraph endpoints to network and some linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .../subgraph-service/contracts/SubgraphService.sol | 12 ++++++++---- packages/subgraph-service/eslint.config.js | 2 +- packages/token-distribution/.env.sample | 1 + packages/token-distribution/.graphclientrc.yml | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/subgraph-service/contracts/SubgraphService.sol b/packages/subgraph-service/contracts/SubgraphService.sol index 0045b970d..d0db789b9 100644 --- a/packages/subgraph-service/contracts/SubgraphService.sol +++ b/packages/subgraph-service/contracts/SubgraphService.sol @@ -343,9 +343,9 @@ contract SubgraphService is /** * @notice See {ISubgraphService.setStakeToFeesRatio} */ - function setStakeToFeesRatio(uint256 _stakeToFeesRatio) external override onlyOwner { - stakeToFeesRatio = _stakeToFeesRatio; - emit StakeToFeesRatioSet(_stakeToFeesRatio); + function setStakeToFeesRatio(uint256 stakeToFeesRatio_) external override onlyOwner { + stakeToFeesRatio = stakeToFeesRatio_; + emit StakeToFeesRatioSet(stakeToFeesRatio_); } /** @@ -358,7 +358,11 @@ contract SubgraphService is /** * @notice See {ISubgraphService.setPaymentCuts} */ - function setPaymentCuts(IGraphPayments.PaymentTypes paymentType, uint128 serviceCut, uint128 curationCut) external override onlyOwner { + function setPaymentCuts( + IGraphPayments.PaymentTypes paymentType, + uint128 serviceCut, + uint128 curationCut + ) external override onlyOwner { paymentCuts[paymentType] = PaymentCuts(serviceCut, curationCut); emit PaymentCutsSet(paymentType, serviceCut, curationCut); } diff --git a/packages/subgraph-service/eslint.config.js b/packages/subgraph-service/eslint.config.js index 2cb4335fd..c9e06b116 100644 --- a/packages/subgraph-service/eslint.config.js +++ b/packages/subgraph-service/eslint.config.js @@ -16,6 +16,6 @@ module.exports = [ }, }, { - ignores: ['typechain-types/*'], + ignores: ['typechain-types/*', 'lib/*'], }, ] diff --git a/packages/token-distribution/.env.sample b/packages/token-distribution/.env.sample index 1ecb4d424..feae0f5fe 100644 --- a/packages/token-distribution/.env.sample +++ b/packages/token-distribution/.env.sample @@ -1,3 +1,4 @@ MNEMONIC= ETHERSCAN_API_KEY= INFURA_KEY= +STUDIO_API_KEY= diff --git a/packages/token-distribution/.graphclientrc.yml b/packages/token-distribution/.graphclientrc.yml index 34d67cb06..3ab12d3ca 100644 --- a/packages/token-distribution/.graphclientrc.yml +++ b/packages/token-distribution/.graphclientrc.yml @@ -2,13 +2,13 @@ sources: - name: graph-network handler: graphql: - endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet + endpoint: https://gateway.thegraph.com/api/${STUDIO_API_KEY}/subgraphs/id/9Co7EQe5PgW3ugCUJrJgRv4u9zdEuDJf8NvMWftNsBH8 retry: 5 - name: token-distribution handler: graphql: - endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/token-distribution + endpoint: https://gateway.thegraph.com/api/${STUDIO_API_KEY}/subgraphs/id/ChfAJn6jQEBjVqtdUiThfG6sWy2Sr5XQPNucE9DkgXSN retry: 5 transforms: - autoPagination: From d0256329ac2669a0c7d6c7bef9c0795d1dfdffe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 15 Aug 2024 16:35:21 -0300 Subject: [PATCH 2/4] fix: add STUDIO_API_KEY to GitHub action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .github/workflows/ci-token-dist.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-token-dist.yml b/.github/workflows/ci-token-dist.yml index f45eb9111..c0e73b072 100644 --- a/.github/workflows/ci-token-dist.yml +++ b/.github/workflows/ci-token-dist.yml @@ -2,6 +2,7 @@ name: CI - packages/token-distribution env: CI: true + STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }} on: push: From 8345a1f28e19cbe0d9c1bbf55f8fe764622827ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 15 Aug 2024 16:37:07 -0300 Subject: [PATCH 3/4] fix: missing env var declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62e6408fe..9536e68e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,7 @@ name: Build env: CI: true + STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }} on: push: From 5c5787a4ca5d344c0ec6dfb48af0843d5e70cd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 15 Aug 2024 17:02:59 -0300 Subject: [PATCH 4/4] ci: build packages individudally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .github/actions/setup/action.yml | 3 --- .github/workflows/build.yml | 4 +++- .github/workflows/ci-contracts.yml | 4 ++++ .github/workflows/ci-data-edge.yml | 4 ++++ .github/workflows/ci-horizon.yml | 4 ++++ .github/workflows/ci-subgraph-service.yml | 4 ++++ .github/workflows/ci-token-dist.yml | 4 ++++ .github/workflows/e2e-contracts.yml | 4 ++++ .github/workflows/verifydeployed.yml | 10 ++++++++-- 9 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index baeec7b27..310c412bd 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,6 +17,3 @@ runs: - name: Install dependencies shell: bash run: yarn --immutable - - name: Build - shell: bash - run: yarn build || yarn build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9536e68e3..2a7a8b2ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,4 +20,6 @@ jobs: with: submodules: recursive - name: Set up environment - uses: ./.github/actions/setup \ No newline at end of file + uses: ./.github/actions/setup + - name: Build + run: yarn build || yarn build \ No newline at end of file diff --git a/.github/workflows/ci-contracts.yml b/.github/workflows/ci-contracts.yml index 7dca1bfde..d60ab0d9b 100644 --- a/.github/workflows/ci-contracts.yml +++ b/.github/workflows/ci-contracts.yml @@ -24,6 +24,10 @@ jobs: submodules: recursive - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/contracts + yarn build || yarn build - name: Run tests run: | pushd packages/contracts diff --git a/.github/workflows/ci-data-edge.yml b/.github/workflows/ci-data-edge.yml index 065e0f964..a8046aa7e 100644 --- a/.github/workflows/ci-data-edge.yml +++ b/.github/workflows/ci-data-edge.yml @@ -22,5 +22,9 @@ jobs: uses: actions/checkout@v4 - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/data-edge + yarn build - name: Run tests run: yarn test \ No newline at end of file diff --git a/.github/workflows/ci-horizon.yml b/.github/workflows/ci-horizon.yml index d450d1264..159ca7b4d 100644 --- a/.github/workflows/ci-horizon.yml +++ b/.github/workflows/ci-horizon.yml @@ -24,6 +24,10 @@ jobs: submodules: recursive - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/horizon + yarn build - name: Run tests run: | pushd packages/horizon diff --git a/.github/workflows/ci-subgraph-service.yml b/.github/workflows/ci-subgraph-service.yml index bda15deff..141c3549d 100644 --- a/.github/workflows/ci-subgraph-service.yml +++ b/.github/workflows/ci-subgraph-service.yml @@ -24,6 +24,10 @@ jobs: submodules: recursive - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/subgraph-service + yarn build - name: Run tests run: | pushd packages/subgraph-service diff --git a/.github/workflows/ci-token-dist.yml b/.github/workflows/ci-token-dist.yml index c0e73b072..b991c1608 100644 --- a/.github/workflows/ci-token-dist.yml +++ b/.github/workflows/ci-token-dist.yml @@ -25,6 +25,10 @@ jobs: submodules: recursive - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/token-distribution + yarn build - name: Run tests run: | pushd packages/token-distribution diff --git a/.github/workflows/e2e-contracts.yml b/.github/workflows/e2e-contracts.yml index c84adb1a0..ce5540add 100644 --- a/.github/workflows/e2e-contracts.yml +++ b/.github/workflows/e2e-contracts.yml @@ -34,6 +34,10 @@ jobs: submodules: recursive - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/contracts + yarn build || yarn build - name: Run e2e tests run: | git clone https://github.com/OffchainLabs/nitro-testnode/ diff --git a/.github/workflows/verifydeployed.yml b/.github/workflows/verifydeployed.yml index 9de43994c..db5b90133 100644 --- a/.github/workflows/verifydeployed.yml +++ b/.github/workflows/verifydeployed.yml @@ -30,8 +30,10 @@ jobs: - name: Set up environment uses: ./.github/actions/setup - - name: Compile contracts - run: yarn build + - name: Build + run: | + pushd packages/contracts + yarn build || yarn build - name: Save build artifacts uses: actions/upload-artifact@v3 @@ -50,6 +52,10 @@ jobs: uses: actions/checkout@v3 - name: Set up environment uses: ./.github/actions/setup + - name: Build + run: | + pushd packages/contracts + yarn build || yarn build - name: Get build artifacts uses: actions/download-artifact@v3 with: