@graphprotocol/graph-cli 0.22.3 → 0.23.1

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 (64) hide show
  1. package/README.md +83 -0
  2. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/.travis.yml +4 -0
  3. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/ethereum.ts +9 -15
  4. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/near.ts +402 -0
  5. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/collections.ts +125 -4
  6. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/eager_offset.ts +2 -1
  7. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/json.ts +14 -0
  8. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/numbers.ts +58 -16
  9. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/common/value.ts +2 -5
  10. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/global/global.ts +108 -0
  11. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/helper-functions.ts +5 -5
  12. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/index.ts +6 -15
  13. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/package.json +5 -2
  14. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/bigInt.ts +138 -108
  15. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/bytes.ts +31 -20
  16. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/test.js +120 -88
  17. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/tsconfig.json +2 -2
  18. package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/types/tsconfig.base.json +3 -0
  19. package/examples/basic-event-handlers/node_modules/websocket/build/Makefile +2 -2
  20. package/examples/basic-event-handlers/package.json +1 -1
  21. package/examples/basic-event-handlers/yarn.lock +4 -4
  22. package/examples/example-subgraph/package.json +1 -1
  23. package/examples/example-subgraph/yarn.lock +4 -4
  24. package/examples/near/.gitkeep +0 -0
  25. package/jest.config.js +2 -2
  26. package/manifest-schema.graphql +35 -2
  27. package/package.json +2 -6
  28. package/src/codegen/schema.js +1 -2
  29. package/src/codegen/template.js +9 -51
  30. package/src/codegen/typescript.js +7 -0
  31. package/src/command-helpers/compiler.js +6 -2
  32. package/src/command-helpers/data-sources.js +38 -0
  33. package/src/command-helpers/fs.js +8 -0
  34. package/src/commands/build.js +14 -0
  35. package/src/commands/codegen.js +8 -0
  36. package/src/commands/deploy.js +11 -8
  37. package/src/commands/init.js +35 -11
  38. package/src/commands/test.js +9 -4
  39. package/src/compiler/index.js +93 -76
  40. package/src/{abi.js → protocols/ethereum/abi.js} +0 -0
  41. package/src/{codegen → protocols/ethereum/codegen}/abi.js +9 -6
  42. package/src/{codegen → protocols/ethereum/codegen}/abi.test.js +1 -1
  43. package/src/protocols/ethereum/codegen/template.js +42 -0
  44. package/src/protocols/ethereum/subgraph.js +205 -0
  45. package/src/protocols/ethereum/type-generator.js +203 -0
  46. package/src/protocols/index.js +97 -0
  47. package/src/protocols/near/subgraph.js +42 -0
  48. package/src/scaffold.js +21 -4
  49. package/src/scaffold.test.js +1 -1
  50. package/src/subgraph.js +30 -252
  51. package/src/type-generator.js +31 -211
  52. package/src/validation/index.js +1 -0
  53. package/src/validation/manifest.js +73 -23
  54. package/src/validation/schema.js +6 -0
  55. package/subgraph-ethereum.yaml +134 -0
  56. package/subgraph-near.yaml +134 -0
  57. package/tests/cli/globalSetup.js +6 -0
  58. package/tests/cli/globalTeardown.js +6 -0
  59. package/tests/cli/init.test.js +1 -1
  60. package/tests/cli/util.js +17 -8
  61. package/tests/cli/validation/near-is-valid/mapping.ts +0 -0
  62. package/tests/cli/validation/near-is-valid/schema.graphql +8 -0
  63. package/tests/cli/validation/near-is-valid/subgraph.yaml +21 -0
  64. package/tests/cli/validation.test.js +8 -0
@@ -1,4 +1,5 @@
1
1
  module.exports = {
2
2
  validateSchema: require('./schema').validateSchema,
3
3
  validateManifest: require('./manifest').validateManifest,
4
+ validateContractValues: require('./manifest').validateContractValues,
4
5
  }
@@ -51,13 +51,24 @@ const validators = immutable.fromJS({
51
51
  ScalarTypeDefinition: (value, ctx) =>
52
52
  validators.get(ctx.getIn(['type', 'name', 'value']))(value, ctx),
53
53
 
54
- UnionTypeDefinition: (value, ctx) =>
55
- ctx
54
+ UnionTypeDefinition: (value, ctx) => {
55
+ const unionVariants = ctx
56
56
  .getIn(['type', 'types'])
57
- .reduce(
58
- (errors, type) => errors.concat(validateValue(value, ctx.set('type', type))),
59
- List(),
60
- ),
57
+
58
+ let errors = List()
59
+
60
+ for (const variantType of unionVariants) {
61
+ const variantErrors = validateValue(value, ctx.set('type', variantType))
62
+ // No errors found, union variant matched, early return
63
+ if (variantErrors.isEmpty()) {
64
+ return List()
65
+ }
66
+ errors = errors.push(variantErrors)
67
+ }
68
+
69
+ // Return errors from variant that matched the most
70
+ return List(errors.minBy(variantErrors => variantErrors.count()))
71
+ },
61
72
 
62
73
  NamedType: (value, ctx) =>
63
74
  validateValue(
@@ -199,9 +210,8 @@ const validateValue = (value, ctx) => {
199
210
  }
200
211
  }
201
212
 
202
- const validateDataSourceNetworks = value => {
203
- let networks = [...value.dataSources, ...(value.templates || [])]
204
- .filter(dataSource => dataSource.kind === 'ethereum/contract')
213
+ const validateDataSourceForNetwork = (dataSources, protocol) =>
214
+ dataSources.filter(dataSource => protocol.isValidKindName(dataSource.kind))
205
215
  .reduce(
206
216
  (networks, dataSource) =>
207
217
  networks.update(dataSource.network, dataSources =>
@@ -210,28 +220,37 @@ const validateDataSourceNetworks = value => {
210
220
  immutable.OrderedMap(),
211
221
  )
212
222
 
213
- return networks.size > 1
214
- ? immutable.fromJS([
215
- {
216
- path: [],
217
- message: `Conflicting networks used in data sources and templates:
223
+ const validateDataSourceNetworks = (value, protocol) => {
224
+ const dataSources = [...value.dataSources, ...(value.templates || [])]
225
+
226
+ // Networks found valid for a protocol.
227
+ // By searching through all data sources and templates.
228
+ const networks = validateDataSourceForNetwork(dataSources, protocol)
229
+
230
+ if (networks.size > 1) {
231
+ return immutable.fromJS([
232
+ {
233
+ path: [],
234
+ message: `Conflicting networks used in data sources and templates:
218
235
  ${networks
219
236
  .map(
220
237
  (dataSources, network) =>
221
- ` ${
238
+ ` ${
222
239
  network === undefined
223
240
  ? 'Data sources and templates having no network set'
224
- : `Data sources and templates using '${network}'`
225
- }:\n${dataSources.map(ds => ` - ${ds}`).join('\n')}`,
241
+ : `Data sources and templates using '${network}'`
242
+ }:\n${dataSources.map(ds => ` - ${ds}`).join('\n')}`,
226
243
  )
227
244
  .join('\n')}
228
245
  Recommendation: Make all data sources and templates use the same network name.`,
229
- },
230
- ])
231
- : List()
246
+ },
247
+ ])
248
+ }
249
+
250
+ return List()
232
251
  }
233
252
 
234
- const validateManifest = (value, type, schema, { resolveFile }) => {
253
+ const validateManifest = (value, type, schema, protocol, { resolveFile }) => {
235
254
  // Validate manifest using the GraphQL schema that defines its structure
236
255
  let errors =
237
256
  value !== null && value !== undefined
@@ -260,7 +279,38 @@ const validateManifest = (value, type, schema, { resolveFile }) => {
260
279
 
261
280
  // Validate that all data sources are for the same `network` (this includes
262
281
  // _no_ network at all)
263
- return validateDataSourceNetworks(value)
282
+ return validateDataSourceNetworks(value, protocol)
264
283
  }
265
284
 
266
- module.exports = { validateManifest }
285
+ const validateContractValues = (manifest, protocol, fieldName, validator, errorMessage) =>
286
+ manifest
287
+ .get('dataSources')
288
+ .filter(dataSource => protocol.isValidKindName(dataSource.get('kind')))
289
+ .reduce((errors, dataSource, dataSourceIndex) => {
290
+ let path = ['dataSources', dataSourceIndex, 'source', fieldName]
291
+
292
+ // No need to validate if the source has no contract field
293
+ if (!dataSource.get('source').has(fieldName)) {
294
+ return errors
295
+ }
296
+
297
+ let contractValue = dataSource.getIn(['source', fieldName])
298
+
299
+ // Validate whether the contract is valid
300
+ if (validator(contractValue)) {
301
+ return errors
302
+ } else {
303
+ return errors.push(
304
+ immutable.fromJS({
305
+ path,
306
+ message: `\
307
+ Contract ${fieldName} is invalid: ${contractValue}${errorMessage ? `\n${errorMessage}` : ''}`,
308
+ }),
309
+ )
310
+ }
311
+ }, immutable.List())
312
+
313
+ module.exports = {
314
+ validateManifest,
315
+ validateContractValues,
316
+ }
@@ -20,6 +20,12 @@ const BUILTIN_SCALAR_TYPES = [
20
20
  const TYPE_SUGGESTIONS = [
21
21
  ['Address', 'Bytes'],
22
22
  ['address', 'Bytes'],
23
+ ['Account', 'String'],
24
+ ['account', 'String'],
25
+ ['AccountId', 'String'],
26
+ ['AccountID', 'String'],
27
+ ['accountId', 'String'],
28
+ ['accountid', 'String'],
23
29
  ['bytes', 'Bytes'],
24
30
  ['string', 'String'],
25
31
  ['bool', 'Boolean'],
@@ -0,0 +1,134 @@
1
+ specVersion: 0.0.2
2
+ schema:
3
+ file: ./schema.graphql
4
+ dataSources:
5
+ - kind: ethereum/contract
6
+ name: NiftyInk
7
+ network: xdai
8
+ source:
9
+ address: "0x49dE55fbA08af88f55EB797a456fdf76B151c8b0"
10
+ abi: NiftyInk
11
+ startBlock: 11296636
12
+ mapping:
13
+ kind: ethereum/events
14
+ apiVersion: 0.0.5
15
+ language: wasm/assemblyscript
16
+ entities:
17
+ - Ink
18
+ - Artist
19
+ - InkNumberLookUp
20
+ abis:
21
+ - name: NiftyInk
22
+ file: ./abis/NiftyInk.json
23
+ eventHandlers:
24
+ - event: newInk(uint256,indexed address,string,string,uint256)
25
+ handler: handlenewInk
26
+ callHandlers:
27
+ - function: setPrice(string,uint256)
28
+ handler: handleSetPrice
29
+ - function: setPriceFromSignature(string,uint256,bytes)
30
+ handler: handleSetPriceFromSignature
31
+ file: ./src/mapping.ts
32
+ - kind: ethereum/contract
33
+ name: NiftyToken
34
+ network: xdai
35
+ source:
36
+ address: "0xCF964c89f509a8c0Ac36391c5460dF94B91daba5"
37
+ abi: NiftyToken
38
+ startBlock: 11296637
39
+ mapping:
40
+ kind: ethereum/events
41
+ apiVersion: 0.0.5
42
+ language: wasm/assemblyscript
43
+ entities:
44
+ - Ink
45
+ - Token
46
+ - Sale
47
+ - Transfer
48
+ abis:
49
+ - name: NiftyToken
50
+ file: ./abis/NiftyToken.json
51
+ - name: NiftyInk
52
+ file: ./abis/NiftyInk.json
53
+ eventHandlers:
54
+ - event: Transfer(indexed address,indexed address,indexed uint256)
55
+ handler: handleTransfer
56
+ - event: boughtInk(uint256,string,address,uint256)
57
+ handler: handleBoughtInk
58
+ - event: mintedInk(uint256,string,address)
59
+ handler: handleMintedInk
60
+ callHandlers:
61
+ - function: setTokenPrice(uint256,uint256)
62
+ handler: handleSetTokenPrice
63
+ file: ./src/mapping.ts
64
+ # - kind: ethereum/contract
65
+ # name: NiftyMain
66
+ # network: mainnet
67
+ # source:
68
+ # address: "0xc02697c417DdAcfbe5EdbF23eDad956BC883F4fb"
69
+ # abi: NiftyMain
70
+ # startBlock: 10609660
71
+ # mapping:
72
+ # kind: ethereum/events
73
+ # apiVersion: 0.0.4
74
+ # language: wasm/assemblyscript
75
+ # entities:
76
+ # - Token
77
+ # - Transfer
78
+ # abis:
79
+ # - name: NiftyMain
80
+ # file: ./abis/NiftyMain.json
81
+ # - name: NiftyToken
82
+ # file: ./abis/NiftyToken.json
83
+ # eventHandlers:
84
+ # - event: Transfer(indexed address,indexed address,indexed uint256)
85
+ # handler: handleTransfer
86
+ # - event: mintedInk(uint256,string,address)
87
+ # handler: handleMintedOnMain
88
+ # file: ./src/mapping.ts
89
+ - kind: ethereum/contract
90
+ name: NiftyMediator
91
+ network: xdai
92
+ source:
93
+ address: "0x73cA9C4e72fF109259cf7374F038faf950949C51"
94
+ abi: NiftyMediator
95
+ startBlock: 11296637
96
+ mapping:
97
+ kind: ethereum/events
98
+ apiVersion: 0.0.5
99
+ language: wasm/assemblyscript
100
+ entities:
101
+ - Token
102
+ abis:
103
+ - name: NiftyMediator
104
+ file: ./abis/NiftyMediator.json
105
+ - name: NiftyToken
106
+ file: ./abis/NiftyToken.json
107
+ eventHandlers:
108
+ - event: tokenSentViaBridge(uint256,bytes32)
109
+ handler: handleTokenSentViaBridge
110
+ - event: newPrice(uint256)
111
+ handler: handleNewRelayPrice
112
+ file: ./src/mapping.ts
113
+ - kind: ethereum/contract
114
+ name: Liker
115
+ network: xdai
116
+ source:
117
+ address: "0xBD0621dcb64e1EEd503f709422b019B2fA197aF6"
118
+ abi: Liker
119
+ startBlock: 11296637
120
+ mapping:
121
+ kind: ethereum/events
122
+ apiVersion: 0.0.5
123
+ language: wasm/assemblyscript
124
+ entities:
125
+ - InkLookUp
126
+ - Like
127
+ - Ink
128
+ abis:
129
+ - name: Liker
130
+ file: ./abis/Liker.json
131
+ eventHandlers:
132
+ - event: liked(uint256,address,uint256,uint256,address)
133
+ handler: handleLikedInk
134
+ file: ./src/mapping.ts
@@ -0,0 +1,134 @@
1
+ specVersion: 0.0.2
2
+ schema:
3
+ file: ./schema.graphql
4
+ dataSources:
5
+ - kind: ethereum/contract
6
+ name: NiftyInk
7
+ network: xdai
8
+ source:
9
+ address: "0x49dE55fbA08af88f55EB797a456fdf76B151c8b0"
10
+ abi: NiftyInk
11
+ startBlock: 11296636
12
+ mapping:
13
+ kind: ethereum/events
14
+ apiVersion: 0.0.5
15
+ language: wasm/assemblyscript
16
+ entities:
17
+ - Ink
18
+ - Artist
19
+ - InkNumberLookUp
20
+ abis:
21
+ - name: NiftyInk
22
+ file: ./abis/NiftyInk.json
23
+ eventHandlers:
24
+ - event: newInk(uint256,indexed address,string,string,uint256)
25
+ handler: handlenewInk
26
+ callHandlers:
27
+ - function: setPrice(string,uint256)
28
+ handler: handleSetPrice
29
+ - function: setPriceFromSignature(string,uint256,bytes)
30
+ handler: handleSetPriceFromSignature
31
+ file: ./src/mapping.ts
32
+ - kind: ethereum/contract
33
+ name: NiftyToken
34
+ network: xdai
35
+ source:
36
+ address: "0xCF964c89f509a8c0Ac36391c5460dF94B91daba5"
37
+ abi: NiftyToken
38
+ startBlock: 11296637
39
+ mapping:
40
+ kind: ethereum/events
41
+ apiVersion: 0.0.5
42
+ language: wasm/assemblyscript
43
+ entities:
44
+ - Ink
45
+ - Token
46
+ - Sale
47
+ - Transfer
48
+ abis:
49
+ - name: NiftyToken
50
+ file: ./abis/NiftyToken.json
51
+ - name: NiftyInk
52
+ file: ./abis/NiftyInk.json
53
+ eventHandlers:
54
+ - event: Transfer(indexed address,indexed address,indexed uint256)
55
+ handler: handleTransfer
56
+ - event: boughtInk(uint256,string,address,uint256)
57
+ handler: handleBoughtInk
58
+ - event: mintedInk(uint256,string,address)
59
+ handler: handleMintedInk
60
+ callHandlers:
61
+ - function: setTokenPrice(uint256,uint256)
62
+ handler: handleSetTokenPrice
63
+ file: ./src/mapping.ts
64
+ # - kind: ethereum/contract
65
+ # name: NiftyMain
66
+ # network: mainnet
67
+ # source:
68
+ # address: "0xc02697c417DdAcfbe5EdbF23eDad956BC883F4fb"
69
+ # abi: NiftyMain
70
+ # startBlock: 10609660
71
+ # mapping:
72
+ # kind: ethereum/events
73
+ # apiVersion: 0.0.4
74
+ # language: wasm/assemblyscript
75
+ # entities:
76
+ # - Token
77
+ # - Transfer
78
+ # abis:
79
+ # - name: NiftyMain
80
+ # file: ./abis/NiftyMain.json
81
+ # - name: NiftyToken
82
+ # file: ./abis/NiftyToken.json
83
+ # eventHandlers:
84
+ # - event: Transfer(indexed address,indexed address,indexed uint256)
85
+ # handler: handleTransfer
86
+ # - event: mintedInk(uint256,string,address)
87
+ # handler: handleMintedOnMain
88
+ # file: ./src/mapping.ts
89
+ - kind: ethereum/contract
90
+ name: NiftyMediator
91
+ network: xdai
92
+ source:
93
+ address: "0x73cA9C4e72fF109259cf7374F038faf950949C51"
94
+ abi: NiftyMediator
95
+ startBlock: 11296637
96
+ mapping:
97
+ kind: ethereum/events
98
+ apiVersion: 0.0.5
99
+ language: wasm/assemblyscript
100
+ entities:
101
+ - Token
102
+ abis:
103
+ - name: NiftyMediator
104
+ file: ./abis/NiftyMediator.json
105
+ - name: NiftyToken
106
+ file: ./abis/NiftyToken.json
107
+ eventHandlers:
108
+ - event: tokenSentViaBridge(uint256,bytes32)
109
+ handler: handleTokenSentViaBridge
110
+ - event: newPrice(uint256)
111
+ handler: handleNewRelayPrice
112
+ file: ./src/mapping.ts
113
+ - kind: ethereum/contract
114
+ name: Liker
115
+ network: xdai
116
+ source:
117
+ address: "0xBD0621dcb64e1EEd503f709422b019B2fA197aF6"
118
+ abi: Liker
119
+ startBlock: 11296637
120
+ mapping:
121
+ kind: ethereum/events
122
+ apiVersion: 0.0.5
123
+ language: wasm/assemblyscript
124
+ entities:
125
+ - InkLookUp
126
+ - Like
127
+ - Ink
128
+ abis:
129
+ - name: Liker
130
+ file: ./abis/Liker.json
131
+ eventHandlers:
132
+ - event: liked(uint256,address,uint256,uint256,address)
133
+ handler: handleLikedInk
134
+ file: ./src/mapping.ts
@@ -0,0 +1,6 @@
1
+ const { npmLinkCli } = require('./util')
2
+
3
+ module.exports = async () => {
4
+ process.env.GRAPH_CLI_TESTS = '1'
5
+ await npmLinkCli()
6
+ }
@@ -0,0 +1,6 @@
1
+ const { npmUnlinkCli } = require('./util')
2
+
3
+ module.exports = async () => {
4
+ delete process.env.GRAPH_CLI_TESTS
5
+ await npmUnlinkCli()
6
+ }
@@ -1,6 +1,6 @@
1
1
  const fs = require('fs-extra')
2
2
  const path = require('path')
3
- const cliTest = require('./util').cliTest
3
+ const { cliTest } = require('./util')
4
4
 
5
5
  describe('Init', () => {
6
6
  let baseDir = path.join(__dirname, 'init')
package/tests/cli/util.js CHANGED
@@ -13,7 +13,7 @@ const cliTest = (title, args, testPath, options) => {
13
13
  let cwd =
14
14
  options !== undefined && options.cwd ? options.cwd : resolvePath(`./${testPath}`)
15
15
 
16
- let [exitCode, stdout, stderr] = await runCli(args, cwd)
16
+ let [exitCode, stdout, stderr] = await runGraphCli(args, cwd)
17
17
 
18
18
  let expectedExitCode = undefined
19
19
  if (options !== undefined && options.exitCode !== undefined) {
@@ -55,18 +55,14 @@ const cliTest = (title, args, testPath, options) => {
55
55
  )
56
56
  }
57
57
 
58
- const runCli = async (args = [], cwd = process.cwd()) => {
59
- // Resolve the path to graph.js
60
- let graphCli = path.join(__dirname, '..', '..', 'bin', 'graph')
61
-
58
+ const runCommand = async (command, args = [], cwd = process.cwd()) => {
62
59
  // Make sure to set an absolute working directory
63
60
  cwd = cwd[0] !== '/' ? path.resolve(__dirname, cwd) : cwd
64
61
 
65
62
  return new Promise((resolve, reject) => {
66
63
  let stdout = ''
67
64
  let stderr = ''
68
- const command = `${graphCli} ${args.join(' ')}`
69
- const child = spawn(command, { cwd })
65
+ const child = spawn(`${command} ${args.join(' ')}`, { cwd })
70
66
 
71
67
  child.on('error', error => {
72
68
  reject(error)
@@ -86,7 +82,20 @@ const runCli = async (args = [], cwd = process.cwd()) => {
86
82
  })
87
83
  }
88
84
 
85
+ const runGraphCli = async (args, cwd) => {
86
+ // Resolve the path to graph.js
87
+ let graphCli = path.join(__dirname, '..', '..', 'bin', 'graph')
88
+
89
+ return await runCommand(graphCli, args, cwd)
90
+ }
91
+
92
+ const npmLinkCli = () => runCommand('npm', ['link'])
93
+
94
+ const npmUnlinkCli = () => runCommand('npm', ['unlink'])
95
+
89
96
  module.exports = {
90
97
  cliTest,
91
- runCli,
98
+ npmLinkCli,
99
+ npmUnlinkCli,
100
+ runGraphCli,
92
101
  }
File without changes
@@ -0,0 +1,8 @@
1
+ type MyEntity @entity {
2
+ id: ID!
3
+ x: Account!
4
+ }
5
+
6
+ type Account @entity {
7
+ id: ID!
8
+ }
@@ -0,0 +1,21 @@
1
+ specVersion: 0.0.1
2
+ repository: https://github.com/graphprotocol/near-subgraph
3
+ description: NEAR subgraph
4
+ schema:
5
+ file: ./schema.graphql
6
+ dataSources:
7
+ - kind: near
8
+ name: NearSubgraph
9
+ source:
10
+ account: wnear.flux-dev
11
+ startBlock: 1
12
+ mapping:
13
+ apiVersion: 0.0.5
14
+ language: wasm/assemblyscript
15
+ file: ./mapping.ts
16
+ entities:
17
+ - ExampleEntity
18
+ blockHandlers:
19
+ - handler: handleNewBlock
20
+ receiptHandlers:
21
+ - handler: handleReceipt
@@ -144,6 +144,14 @@ describe('Validation', () => {
144
144
  exitCode: 1,
145
145
  },
146
146
  )
147
+ cliTest(
148
+ 'NEAR is a valid chain',
149
+ ['codegen', '--skip-migrations'],
150
+ 'validation/near-is-valid',
151
+ {
152
+ exitCode: 0,
153
+ },
154
+ )
147
155
  cliTest(
148
156
  'Deprecated template format gives nice error',
149
157
  ['codegen', '--skip-migrations'],