Skip to content

Commit 8e04027

Browse files
Fix availableNetworks() (#1129)
* fix availableNetworks() ref #1087 * Create .changeset/breezy-impalas-peel.md * style: prettier --------- Co-authored-by: Saihajpreet Singh <[email protected]>
1 parent b988ab2 commit 8e04027

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.changeset/breezy-impalas-peel.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+
Fix availableNetworks() for substreams

packages/cli/src/commands/init.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ async function processInitForm(
453453
// @ts-expect-error TODO: wait what?
454454
availableNetworks
455455
.get(protocol as ProtocolName) // Get networks related to the chosen protocol.
456-
// @ts-expect-error TODO: wait what?
457456
.toArray()
458457
); // Needed because of gluegun. It can't even receive a JS iterable.
459458
},

packages/cli/src/protocols/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,17 @@ export default class Protocol {
116116
'uni-3', // Juno testnet
117117
],
118118
substreams: ['mainnet'],
119-
}) as immutable.Map<'arweave' | 'ethereum' | 'near' | 'cosmos' | 'substreams', string[]>;
119+
}) as immutable.Map<
120+
'arweave' | 'ethereum' | 'near' | 'cosmos' | 'substreams',
121+
immutable.List<string>
122+
>;
120123

121124
const allNetworks: string[] = [];
122125
networks.forEach(value => {
123126
allNetworks.push(...value);
124127
});
125128

126-
networks = networks.set('substreams', allNetworks);
129+
networks = networks.set('substreams', immutable.List(allNetworks));
127130

128131
return networks;
129132
}

0 commit comments

Comments
 (0)