@graphprotocol/graph-cli 0.37.0 → 0.37.1-alpha-20221207192322-dd39b34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +6 -3
  3. package/src/command-helpers/abi.js +2 -0
  4. package/src/command-helpers/network.test.js +13 -10
  5. package/tests/cli/validation/call-handler-with-tuple/generated/schema.ts +44 -0
  6. package/tests/cli/validation/example-values-found/generated/ExampleSubgraph/ExampleContract.ts +35 -0
  7. package/tests/cli/validation/example-values-found/generated/schema.ts +44 -0
  8. package/tests/cli/validation/source-without-address-is-valid/generated/ExampleSubgraph/ExampleContract.ts +35 -0
  9. package/.eslintrc +0 -10
  10. package/.prettierrc.json +0 -6
  11. package/.travis.yml +0 -37
  12. package/CONTRIBUTING.md +0 -16
  13. package/LICENSE-APACHE +0 -190
  14. package/LICENSE-MIT +0 -21
  15. package/NEWS.md +0 -80
  16. package/README.md +0 -146
  17. package/examples/basic-event-handlers/LICENSE +0 -21
  18. package/examples/basic-event-handlers/README.md +0 -3
  19. package/examples/basic-event-handlers/abis/Gravity.json +0 -1
  20. package/examples/basic-event-handlers/bin/Counter.bin +0 -1
  21. package/examples/basic-event-handlers/build/Gravity/Gravity.wasm +0 -0
  22. package/examples/basic-event-handlers/build/Gravity/abis/Gravity.json +0 -199
  23. package/examples/basic-event-handlers/build/schema.graphql +0 -13
  24. package/examples/basic-event-handlers/build/subgraph.yaml +0 -27
  25. package/examples/basic-event-handlers/contracts/Gravity.sol +0 -62
  26. package/examples/basic-event-handlers/contracts/Migrations.sol +0 -23
  27. package/examples/basic-event-handlers/generated/Gravity/Gravity.ts +0 -343
  28. package/examples/basic-event-handlers/generated/schema.ts +0 -133
  29. package/examples/basic-event-handlers/migrations/1_initial_migration.js +0 -5
  30. package/examples/basic-event-handlers/migrations/2_deploy_contract.js +0 -5
  31. package/examples/basic-event-handlers/migrations/3_create_gravatars.js +0 -14
  32. package/examples/basic-event-handlers/migrations/4_update_gravatars.js +0 -9
  33. package/examples/basic-event-handlers/package.json +0 -24
  34. package/examples/basic-event-handlers/schema.graphql +0 -13
  35. package/examples/basic-event-handlers/src/mapping.ts +0 -21
  36. package/examples/basic-event-handlers/subgraph.yaml +0 -27
  37. package/examples/basic-event-handlers/test/handlers.js +0 -110
  38. package/examples/basic-event-handlers/truffle.js +0 -34
  39. package/examples/basic-event-handlers/yarn.lock +0 -1027
  40. package/examples/example-subgraph/abis/ExampleContract.json +0 -2388
  41. package/examples/example-subgraph/dist/ExampleSubgraph/ExampleSubgraph.wasm +0 -0
  42. package/examples/example-subgraph/dist/ExampleSubgraph/abis/ExampleContract.json +0 -2394
  43. package/examples/example-subgraph/dist/abis/ExampleContract.json +0 -2388
  44. package/examples/example-subgraph/dist/schema.graphql +0 -37
  45. package/examples/example-subgraph/dist/subgraph.yaml +0 -26
  46. package/examples/example-subgraph/package.json +0 -15
  47. package/examples/example-subgraph/schema.graphql +0 -37
  48. package/examples/example-subgraph/src/mapping.ts +0 -286
  49. package/examples/example-subgraph/subgraph.yaml +0 -26
  50. package/examples/example-subgraph/yarn.lock +0 -28
  51. package/resources/test/docker-compose-standalone-node.yml +0 -20
  52. package/resources/test/docker-compose.yml +0 -43
@@ -1,110 +0,0 @@
1
- const path = require('path')
2
- const { system, patching } = require('gluegun')
3
- const { createApolloFetch } = require('apollo-fetch')
4
-
5
- const GravatarRegistry = artifacts.require('./GravatarRegistry.sol')
6
-
7
- const srcDir = path.join(__dirname, '..')
8
-
9
- const fetchSubgraphs = createApolloFetch({ uri: 'http://localhost:18030/graphql' })
10
- const fetchSubgraph = createApolloFetch({
11
- uri: 'http://localhost:18000/subgraphs/name/test/basic-event-handlers',
12
- })
13
-
14
- const waitForSubgraphToBeSynced = async () =>
15
- new Promise((resolve, reject) => {
16
- // Wait for 10s
17
- let deadline = Date.now() + 10 * 1000
18
-
19
- const checkSubgraphSynced = async () => {
20
- if (Date.now() > deadline) {
21
- reject('Timeout while waiting for the subgraph to be synced')
22
- }
23
-
24
- // Query the subgraph meta data for the indexing status
25
- let result = await fetchSubgraphs({
26
- query: `
27
- {
28
- statuses: indexingStatusesForSubgraphName(
29
- subgraphName: "test/basic-event-handlers"
30
- ) {
31
- synced
32
- }
33
- }
34
- `,
35
- })
36
-
37
- if (
38
- JSON.stringify(result.data) === JSON.stringify({ statuses: [{ synced: true }] })
39
- ) {
40
- setTimeout(resolve, 1000)
41
- } else {
42
- setTimeout(checkSubgraphSynced, 500)
43
- }
44
- }
45
-
46
- setTimeout(checkSubgraphSynced, 0)
47
- })
48
-
49
- contract('Basic event handlers', accounts => {
50
- // Deploy the subgraph once before all tests
51
- before(async () => {
52
- // Deploy the contract
53
- const registry = await GravatarRegistry.deployed()
54
-
55
- // Insert its address into subgraph manifest
56
- await patching.replace(
57
- path.join(srcDir, 'subgraph.yaml'),
58
- '0x2E645469f354BB4F5c8a05B3b30A929361cf77eC',
59
- registry.address,
60
- )
61
-
62
- // Create and deploy the subgraph
63
- await system.run(`yarn codegen`, { cwd: srcDir })
64
- await system.run(`yarn create-test`, { cwd: srcDir })
65
- await system.run(`yarn deploy-test`, { cwd: srcDir })
66
-
67
- // Wait for the subgraph to be indexed
68
- await waitForSubgraphToBeSynced()
69
- })
70
-
71
- it('all events are indexed', async () => {
72
- // Query the subgraph for entities
73
- let result = await fetchSubgraph({
74
- query: `
75
- {
76
- newGravatars(orderBy: id) { id displayName imageUrl }
77
- updatedGravatars(orderBy: id) { id displayName imageUrl }
78
- }
79
- `,
80
- })
81
-
82
- expect(result.errors).to.be.undefined
83
- expect(result.data).to.deep.equal({
84
- newGravatars: [
85
- {
86
- displayName: 'Carl',
87
- id: '0x1',
88
- imageUrl: 'https://thegraph.com/img/team/team_04.png',
89
- },
90
- {
91
- displayName: 'Lucas',
92
- id: '0x2',
93
- imageUrl: 'https://thegraph.com/img/team/bw_Lucas.jpg',
94
- },
95
- ],
96
- updatedGravatars: [
97
- {
98
- displayName: 'Nena',
99
- id: '0x1',
100
- imageUrl: 'https://thegraph.com/img/team/team_04.png',
101
- },
102
- {
103
- displayName: 'Jorge',
104
- id: '0x2',
105
- imageUrl: 'https://thegraph.com/img/team/bw_Lucas.jpg',
106
- },
107
- ],
108
- })
109
- })
110
- })
@@ -1,34 +0,0 @@
1
- require('babel-register')
2
- require('babel-polyfill')
3
- const HDWalletProvider = require('truffle-hdwallet-provider')
4
-
5
- module.exports = {
6
- networks: {
7
- development: {
8
- host: '127.0.0.1',
9
- port: 8545,
10
- network_id: '*',
11
- },
12
- ropsten: {
13
- provider: function() {
14
- return new HDWalletProvider(
15
- process.env.MNEMONIC,
16
- `https://ropsten.infura.io/v3/${process.env.ROPSTEN_INFURA_API_KEY}`,
17
- )
18
- },
19
- network_id: '3',
20
- },
21
- test: {
22
- host: 'localhost',
23
- port: 18545,
24
- network_id: '*',
25
- gas: '100000000000',
26
- gasPrice: '1',
27
- },
28
- },
29
- compilers: {
30
- solc: {
31
- version: '0.4.25', // Fetch exact version from solc-bin (default: truffle's version)
32
- },
33
- },
34
- }