Skip to content

Commit 3571a57

Browse files
authored
fix: remove validate studio network checks (#1521)
* fix: remove validate studio network checks * fix lint issues
1 parent c2a68fc commit 3571a57

File tree

5 files changed

+5
-199
lines changed

5 files changed

+5
-199
lines changed

.changeset/three-fans-attend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphprotocol/graph-cli': patch
3+
---
4+
5+
remove studio network validation checks

packages/cli/src/command-helpers/studio.test.ts

Lines changed: 0 additions & 99 deletions
This file was deleted.

packages/cli/src/command-helpers/studio.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/cli/src/commands/deploy.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { DEFAULT_IPFS_URL } from '../command-helpers/ipfs';
1010
import { createJsonRpcClient } from '../command-helpers/jsonrpc';
1111
import { updateSubgraphNetwork } from '../command-helpers/network';
1212
import { chooseNodeUrl, getHostedServiceSubgraphId } from '../command-helpers/node';
13-
import { validateStudioNetwork } from '../command-helpers/studio';
1413
import { assertGraphTsVersion, assertManifestApiVersion } from '../command-helpers/version';
1514
import { GRAPH_CLI_SHARED_HEADERS } from '../constants';
1615
import Protocol from '../protocols';
@@ -410,30 +409,10 @@ export default class DeployCommand extends Command {
410409

411410
await ipfsClient.pin.add(ipfsHash);
412411

413-
try {
414-
const dataSourcesAndTemplates = DataSourcesExtractor.fromManifestString(manifestFile);
415-
416-
for (const { network } of dataSourcesAndTemplates) {
417-
validateStudioNetwork({ studio, product, network });
418-
}
419-
} catch (e) {
420-
this.error(e, { exit: 1 });
421-
}
422-
423412
await deploySubgraph(ipfsHash);
424413
return;
425414
}
426415

427-
try {
428-
const dataSourcesAndTemplates = await DataSourcesExtractor.fromFilePath(manifest);
429-
430-
for (const { network } of dataSourcesAndTemplates) {
431-
validateStudioNetwork({ studio, product, network });
432-
}
433-
} catch (e) {
434-
this.error(e, { exit: 1 });
435-
}
436-
437416
let protocol;
438417
try {
439418
// Checks to make sure deploy doesn't run against

packages/cli/src/commands/init.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { initNetworksConfig } from '../command-helpers/network';
1313
import { chooseNodeUrl } from '../command-helpers/node';
1414
import { generateScaffold, writeScaffold } from '../command-helpers/scaffold';
1515
import { withSpinner } from '../command-helpers/spinner';
16-
import { validateStudioNetwork } from '../command-helpers/studio';
1716
import { getSubgraphBasename, validateSubgraphName } from '../command-helpers/subgraph';
1817
import debugFactory from '../debug';
1918
import Protocol, { ProtocolName } from '../protocols';
@@ -245,8 +244,6 @@ export default class InitCommand extends Command {
245244
subgraphName,
246245
contractName,
247246
node,
248-
studio,
249-
product,
250247
startBlock,
251248
spkgPath,
252249
skipInstall,
@@ -322,8 +319,6 @@ export default class InitCommand extends Command {
322319
indexEvents: answers.indexEvents,
323320
contractName: answers.contractName,
324321
node,
325-
studio: answers.studio,
326-
product: answers.product,
327322
startBlock: answers.startBlock,
328323
spkgPath: answers.spkgPath,
329324
skipInstall,
@@ -1074,8 +1069,6 @@ async function initSubgraphFromContract(
10741069
indexEvents,
10751070
contractName,
10761071
node,
1077-
studio,
1078-
product,
10791072
startBlock,
10801073
spkgPath,
10811074
skipInstall,
@@ -1090,8 +1083,6 @@ async function initSubgraphFromContract(
10901083
indexEvents: boolean;
10911084
contractName?: string;
10921085
node?: string;
1093-
studio: boolean;
1094-
product?: string;
10951086
startBlock?: string;
10961087
spkgPath?: string;
10971088
skipInstall: boolean;
@@ -1132,15 +1123,6 @@ async function initSubgraphFromContract(
11321123
this.error(`ABI does not contain any events`, { exit: 1 });
11331124
}
11341125

1135-
// We can validate this before the scaffold because we receive
1136-
// the network from the form or via command line argument.
1137-
// We don't need to read the manifest in this case.
1138-
try {
1139-
validateStudioNetwork({ studio, product, network });
1140-
} catch (e) {
1141-
this.error(e, { exit: 1 });
1142-
}
1143-
11441126
// Scaffold subgraph
11451127
const scaffold = await withSpinner(
11461128
`Create subgraph scaffold`,

0 commit comments

Comments
 (0)