Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"test": "graph test"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/arweave-blocks-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create arweave-example --node https://api.thegraph.com/deploy/",
"create": "graph create arweave-example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create arweave-example --node http://localhost:8020",
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy arweave-example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy arweave-example -l v0.1.0 --ipfs http://localhost:5001 --node http://localhost:8020",
"remove-local": "graph remove arweave-example --node http://localhost:8020"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-block-filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-block-filtering --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-block-filtering --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-block-filtering --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-block-filtering --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-block-filtering -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-osmosis-token-swaps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create osmosis-token-swaps --node https://api.thegraph.com/deploy/",
"create": "graph create osmosis-token-swaps --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create osmosis-token-swaps --node http://0.0.0.0:8020",
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy osmosis-token-swaps --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy osmosis-token-swaps -l v0.1.0 --ipfs http://0.0.0.0:5001 --node http://0.0.0.0:8020",
"remove-local": "graph remove osmosis-token-swaps --node http://0.0.0.0:8020"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-validator-delegations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-validator-delegations --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-validator-delegations --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-validator-delegations --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-validator-delegations --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-validator-delegations -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
4 changes: 2 additions & 2 deletions examples/cosmos-validator-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create cosmos-validator-rewards --node https://api.thegraph.com/deploy/",
"create": "graph create cosmos-validator-rewards --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create cosmos-validator-rewards --node http://127.0.0.1:8020",
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy cosmos-validator-rewards --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy cosmos-validator-rewards -l v0.1.0 --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"prepare:cosmoshub": "mustache config/cosmoshub.json subgraph.template.yaml > subgraph.yaml",
"prepare:osmosis": "mustache config/osmosis.json subgraph.template.yaml > subgraph.yaml",
Expand Down
4 changes: 2 additions & 2 deletions examples/ethereum-basic-event-handlers/hardhat/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#!/bin/sh

# Change to the correct directory
cd /usr/src/app;
cd /usr/src/app

# Run hardhat
pnpm localnode;
pnpm localnode

# Keep node alive
set -e
Expand Down
10 changes: 5 additions & 5 deletions examples/ethereum-basic-event-handlers/test/handlers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('node:path');
const { system, patching, filesystem } = require('gluegun');
const { createApolloFetch } = require('apollo-fetch');
const { ethers } = require('hardhat');
const { expect } = require('chai');
import path from 'node:path';
import { createApolloFetch } from 'apollo-fetch';
import { expect } from 'chai';
import { filesystem, patching, system } from 'gluegun';
import { ethers } from 'hardhat';

const srcDir = path.join(__dirname, '..');

Expand Down
4 changes: 2 additions & 2 deletions examples/ethereum-gravatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"build": "graph build",
"build:contract": "hardhat compile",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/near-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/near-receipts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"scripts": {
"build": "graph build",
"codegen": "graph codegen",
"create": "graph create example --node https://api.thegraph.com/deploy/",
"create": "graph create example --node https://api.studio.thegraph.com/deploy/",
"create-local": "graph create example --node http://127.0.0.1:8020",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy example --ipfs https://api.thegraph.com/ipfs/ --node https://api.studio.thegraph.com/deploy/",
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"type-check": "pnpm --filter=@graphprotocol/graph-cli type-check"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@theguild/eslint-config": "0.13.1",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@oclif/plugin-autocomplete": "^3.2.11",
"@oclif/plugin-not-found": "^3.2.29",
"@oclif/plugin-warn-if-update-available": "^3.1.24",
"@pinax/graph-networks-registry": "^0.6.5",
"@whatwg-node/fetch": "^0.10.1",
"assemblyscript": "0.27.31",
"binary-install": "^1.1.0",
Expand Down
54 changes: 41 additions & 13 deletions packages/cli/src/command-helpers/abi.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { describe, expect, test } from 'vitest';
import { getStartBlockForContract } from './abi.js';
import { NetworksRegistry } from '@pinax/graph-networks-registry';
import { ContractService } from './contracts';

// An object with some test cases for contract deployment block numbers
const TEST_CONTRACT_START_BLOCKS = {
'arbitrum-goerli': {
'0xde438d54c7b75f798985ae38a4d07b5431702077': 4_488_583,
},
'arbitrum-one': {
'0xF4d73326C13a4Fc5FD7A064217e12780e9Bd62c3': 226_981,
},
Expand All @@ -18,9 +16,6 @@ const TEST_CONTRACT_START_BLOCKS = {
fantom: {
'0xf731202A3cf7EfA9368C2d7bD613926f7A144dB5': 28_771_200,
},
goerli: {
'0xff02b7d59975E76F67B63b20b813a9Ec0f6AbD60': 226_385,
},
mainnet: {
'0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd': 10_736_242,
},
Expand All @@ -36,6 +31,33 @@ const TEST_CONTRACT_START_BLOCKS = {
optimism: {
'0xc35DADB65012eC5796536bD9864eD8773aBc74C4': 7_019_815,
},
celo: {
'0x8084936982D089130e001b470eDf58faCA445008': 10186627,
},
'celo-alfajores': {
'0xc857ea98ab2dae9877c9fd23971152cd2776d0e4': 9_142_263,
},
chapel: {
'0x549fb5626025237351446ac502decdf2f3a4c570': 25_509_955,
},
'fantom-testnet': {
'0xa40f1c7cc67180aa941e9ef66ee32f704e9600a6': 13_679_941,
},
fuji: {
'0x7a2b3f2ca3e0b5867d44ef8bc5ba316f98e05f05': 18_710_858,
},
gnosis: {
'0xdDCbf776dF3dE60163066A5ddDF2277cB445E0F3': 16655565,
},
aurora: {
'0x76FA7f90D3900eB95Cfc58AB12c916984AeC50c8': 77431034,
},
'aurora-testnet': {
'0x76FA7f90D3900eB95Cfc58AB12c916984AeC50c8': 77431034,
},
fuse: {
'0x3dB01570D97631f69bbb0ba39796865456Cf89A5': 1000000,
},

// Skipping these networks for now because they do not support the latest etherscan contracts API or is blockScout based

Expand Down Expand Up @@ -87,14 +109,20 @@ const TEST_CONTRACT_START_BLOCKS = {
};

// skip this test since its time consuming
describe.skip('getStartBlockForContract', () => {
describe.sequential('getStartBlockForContract', async () => {
const registry = await NetworksRegistry.fromLatestVersion();
const contractService = new ContractService(registry);
for (const [network, contracts] of Object.entries(TEST_CONTRACT_START_BLOCKS)) {
for (const [contract, startBlockExp] of Object.entries(contracts)) {
test(`Returns the start block ${network} ${contract} ${startBlockExp}`, async () => {
//loop through the TEST_CONTRACT_START_BLOCKS object and test each network
const startBlock = await getStartBlockForContract(network, contract);
expect(startBlock).toBe(startBlockExp);
});
test(
`Returns the start block ${network} ${contract} ${startBlockExp}`,
async () => {
//loop through the TEST_CONTRACT_START_BLOCKS object and test each network
const startBlock = await contractService.getStartBlock(network, contract);
expect(parseInt(startBlock)).toBe(startBlockExp);
},
{ timeout: 10000 },
);
}
}
});
Loading