Skip to content

Commit b3d8c99

Browse files
evaporeiazf20
andauthored
Allow gnosis (#970)
* Update studio.js * swap xdai for gnosis * 0.35.0-alpha.0 Co-authored-by: Adam Fuller <[email protected]> Co-authored-by: azf20 <[email protected]>
1 parent 70559ec commit b3d8c99

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/graph-cli",
3-
"version": "0.34.1",
3+
"version": "0.35.0-alpha.0",
44
"license": "(Apache-2.0 OR MIT)",
55
"description": "CLI for building for and deploying to The Graph",
66
"dependencies": {

src/command-helpers/abi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const getEtherscanLikeAPIUrl = (network) => {
6565
case "mbase": return `https://api-moonbase.moonscan.io/api`
6666
case "avalanche": return `https://api.snowtrace.io/api`;
6767
case "fuji": return `https://api-testnet.snowtrace.io/api`;
68+
case "gnosis": return `https://api.gnosisscan.io/api`;
6869
default: return `https://api-${network}.etherscan.io/api`
6970
}
7071
}

src/command-helpers/studio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const allowedStudioNetworks = ['mainnet', 'rinkeby', 'goerli']
1+
const allowedStudioNetworks = ['mainnet', 'rinkeby', 'goerli', 'gnosis']
22

33
const validateStudioNetwork = ({ studio, product, network }) => {
44
let isStudio = studio || product === 'subgraph-studio'

src/command-helpers/studio.test.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ describe('Version Command Helpers', () => {
1212
.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${allowedStudioNetworks.join(', ')}`))
1313
})
1414

15-
test("And it's NOT Ethereum mainnet", () => {
15+
test("And it's Gnosis chain", () => {
16+
expect(() => validateStudioNetwork({
17+
studio: true,
18+
network: 'gnosis',
19+
}))
20+
.not
21+
.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${allowedStudioNetworks.join(', ')}`))
22+
})
23+
24+
test("And it's NOT an allowed network", () => {
1625
expect(() => validateStudioNetwork({
1726
product: 'subgraph-studio',
18-
network: 'xdai',
27+
network: 'celo',
1928
}))
2029
.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${allowedStudioNetworks.join(', ')}`))
2130
})
@@ -31,10 +40,10 @@ describe('Version Command Helpers', () => {
3140
.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${allowedStudioNetworks.join(', ')}`))
3241
})
3342

34-
test("And it's NOT Ethereum mainnet", () => {
43+
test("And it's NOT an allowed network", () => {
3544
expect(() => validateStudioNetwork({
3645
product: 'hosted-service',
37-
network: 'xdai',
46+
network: 'celo',
3847
}))
3948
.not
4049
.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${allowedStudioNetworks.join(', ')}`))

src/protocols/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = class Protocol {
4646
'goerli',
4747
'poa-core',
4848
'poa-sokol',
49-
'xdai',
49+
'gnosis',
5050
'matic',
5151
'mumbai',
5252
'fantom',

src/validation/manifest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ const validateValue = (value, ctx) => {
247247
// [
248248
// { name: 'contract0', kind: 'ethereum/contract', network: 'mainnet' },
249249
// { name: 'contract1', kind: 'ethereum', network: 'mainnet' },
250-
// { name: 'contract2', kind: 'ethereum/contract', network: 'xdai' },
250+
// { name: 'contract2', kind: 'ethereum/contract', network: 'gnosis' },
251251
// { name: 'contract3', kind: 'near', network: 'near-mainnet' },
252252
// ]
253253
//
254254
// Into Immutable JS structure like this (protocol kind is normalized):
255255
// {
256256
// ethereum: {
257257
// mainnet: ['contract0', 'contract1'],
258-
// xdai: ['contract2'],
258+
// gnosis: ['contract2'],
259259
// },
260260
// near: {
261261
// 'near-mainnet': ['contract3'],

0 commit comments

Comments
 (0)