Skip to content

Commit e823e60

Browse files
committed
cli: removing protocolNetwork from actions commands output
1 parent beed3a7 commit e823e60

File tree

8 files changed

+4
-41
lines changed

8 files changed

+4
-41
lines changed

packages/indexer-cli/src/actions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ export async function fetchActions(
387387
first: $first
388388
) {
389389
id
390-
protocolNetwork
391390
type
392391
allocationID
393392
deploymentID

packages/indexer-cli/src/commands/indexer/actions/approve.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
parseOutputFormat,
1010
} from '../../../command-helpers'
1111
import { approveActions, fetchActions } from '../../../actions'
12-
import { ActionStatus, resolveChainAlias } from '@graphprotocol/indexer-common'
12+
import { ActionStatus } from '@graphprotocol/indexer-common'
1313

1414
const HELP = `
1515
${chalk.bold('graph indexer actions approve')} [options] [<actionID1> ...]
@@ -92,15 +92,10 @@ module.exports = {
9292
const queuedAction = await approveActions(client, numericActionIDs)
9393

9494
// Format Actions 'protocolNetwork' field to display human-friendly chain aliases instead of CAIP2-IDs
95-
queuedAction.forEach(
96-
action => (action.protocolNetwork = resolveChainAlias(action.protocolNetwork)),
97-
)
98-
9995
actionSpinner.succeed(`Actions approved`)
10096
printObjectOrArray(print, outputFormat, queuedAction, [
10197
'id',
10298
'type',
103-
'protocolNetwork',
10499
'deploymentID',
105100
'allocationID',
106101
'amount',

packages/indexer-cli/src/commands/indexer/actions/cancel.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { GluegunToolbox } from 'gluegun'
22
import chalk from 'chalk'
3-
import { resolveChainAlias } from '@graphprotocol/indexer-common'
43
import { loadValidatedConfig } from '../../../config'
54
import { createIndexerManagementClient } from '../../../client'
65
import { fixParameters, printObjectOrArray } from '../../../command-helpers'
@@ -67,14 +66,8 @@ module.exports = {
6766

6867
actionSpinner.succeed(`Actions canceled`)
6968

70-
// Format Actions 'protocolNetwork' field to display human-friendly chain aliases instead of CAIP2-IDs
71-
queuedAction.forEach(
72-
action => (action.protocolNetwork = resolveChainAlias(action.protocolNetwork)),
73-
)
74-
7569
printObjectOrArray(print, outputFormat, queuedAction, [
7670
'id',
77-
'protocolNetwork',
7871
'type',
7972
'deploymentID',
8073
'allocationID',

packages/indexer-cli/src/commands/indexer/actions/execute.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { GluegunToolbox } from 'gluegun'
22
import chalk from 'chalk'
3-
import { resolveChainAlias } from '@graphprotocol/indexer-common'
43
import { loadValidatedConfig } from '../../../config'
54
import { createIndexerManagementClient } from '../../../client'
65
import { fixParameters, printObjectOrArray } from '../../../command-helpers'
@@ -60,14 +59,8 @@ module.exports = {
6059

6160
spinner.succeed(`Executed approved actions`)
6261

63-
// Format Actions 'protocolNetwork' field to display human-friendly chain aliases instead of CAIP2-IDs
64-
executedActions.forEach(
65-
action => (action.protocolNetwork = resolveChainAlias(action.protocolNetwork)),
66-
)
67-
6862
printObjectOrArray(print, outputFormat, executedActions, [
6963
'id',
70-
'protocolNetwork',
7164
'status',
7265
'type',
7366
'deploymentID',

packages/indexer-cli/src/commands/indexer/actions/queue.ts

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ module.exports = {
9595

9696
printObjectOrArray(print, outputFormat, queuedAction, [
9797
'id',
98-
'protocolNetwork',
9998
'type',
10099
'deploymentID',
101100
'allocationID',

packages/indexer-cli/src/commands/indexer/actions/update.ts

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ module.exports = {
9898
const displayProperties: (keyof Action)[] = [
9999
'id',
100100
'type',
101-
'protocolNetwork',
102101
'deploymentID',
103102
'allocationID',
104103
'amount',

packages/indexer-cli/src/commands/indexer/allocations/create.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ module.exports = {
4545
return
4646
}
4747

48-
const [deploymentID, protocolNetwork, amount, indexNode] = parameters.array || []
48+
const [deploymentID, amount, indexNode] = parameters.array || []
4949

5050
try {
51-
if (!deploymentID || !amount || !protocolNetwork) {
51+
if (!deploymentID || !amount) {
5252
throw new Error(
5353
'Must provide a deployment ID, a network identifier and allocation amount' +
54-
`(deploymentID: '${deploymentID}', network: '${protocolNetwork}' allocationAmount: '${amount}')`,
54+
`(deploymentID: '${deploymentID}', allocationAmount: '${amount}')`,
5555
)
5656
}
5757

@@ -82,7 +82,6 @@ module.exports = {
8282
'allocation',
8383
'deployment',
8484
'allocatedTokens',
85-
'protocolNetwork',
8685
])
8786
} catch (error) {
8887
spinner.fail(error.toString())

packages/indexer-common/src/indexer-management/__tests__/resolvers/indexing-rules.test.ts

-14
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ const INDEXING_RULE_QUERY = gql`
7878
decisionBasis
7979
requireSupported
8080
safety
81-
protocolNetwork
8281
}
8382
}
8483
`
@@ -101,7 +100,6 @@ const INDEXING_RULES_QUERY = gql`
101100
decisionBasis
102101
requireSupported
103102
safety
104-
protocolNetwork
105103
}
106104
}
107105
`
@@ -170,7 +168,6 @@ describe('Indexing rules', () => {
170168
decisionBasis: IndexingDecisionBasis.RULES,
171169
requireSupported: true,
172170
safety: true,
173-
protocolNetwork: 'eip155:421614',
174171
}
175172

176173
// Update the rule and ensure the right data is returned
@@ -207,12 +204,10 @@ describe('Indexing rules', () => {
207204
decisionBasis: IndexingDecisionBasis.RULES,
208205
requireSupported: true,
209206
safety: true,
210-
protocolNetwork: 'arbitrum-sepolia',
211207
}
212208

213209
const expected = {
214210
...input,
215-
protocolNetwork: 'eip155:421614',
216211
}
217212

218213
// Update the rule
@@ -254,7 +249,6 @@ describe('Indexing rules', () => {
254249
decisionBasis: IndexingDecisionBasis.RULES,
255250
requireSupported: true,
256251
safety: true,
257-
protocolNetwork: 'eip155:421614',
258252
}
259253

260254
// Write the original
@@ -320,7 +314,6 @@ describe('Indexing rules', () => {
320314
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
321315
requireSupported: true,
322316
safety: true,
323-
protocolNetwork: 'eip155:421614',
324317
}
325318

326319
// Write the original
@@ -438,7 +431,6 @@ describe('Indexing rules', () => {
438431
decisionBasis: IndexingDecisionBasis.NEVER,
439432
requireSupported: true,
440433
safety: true,
441-
protocolNetwork: 'eip155:421614',
442434
}
443435

444436
const deploymentExpected = {
@@ -454,7 +446,6 @@ describe('Indexing rules', () => {
454446
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
455447
requireSupported: false,
456448
safety: true,
457-
protocolNetwork: 'eip155:421614',
458449
}
459450
deploymentExpected.identifier = 'QmZSJPm74tvhgr8uzhqvyQm2J6YSbUEj4nF6j8WxxUQLsC'
460451

@@ -529,7 +520,6 @@ describe('Indexing rules', () => {
529520
decisionBasis: IndexingDecisionBasis.RULES,
530521
requireSupported: true,
531522
safety: true,
532-
protocolNetwork: 'eip155:421614',
533523
}
534524

535525
// Write the rule
@@ -593,7 +583,6 @@ describe('Indexing rules', () => {
593583
minAverageQueryFees: null,
594584
custom: null,
595585
decisionBasis: IndexingDecisionBasis.RULES,
596-
protocolNetwork: 'eip155:421614',
597586
}
598587

599588
// Write the rule
@@ -676,7 +665,6 @@ describe('Indexing rules', () => {
676665
decisionBasis: IndexingDecisionBasis.NEVER,
677666
requireSupported: true,
678667
safety: false,
679-
protocolNetwork: 'eip155:421614',
680668
}
681669

682670
const deploymentExpected = {
@@ -692,7 +680,6 @@ describe('Indexing rules', () => {
692680
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
693681
requireSupported: false,
694682
safety: true,
695-
protocolNetwork: 'eip155:421614',
696683
}
697684

698685
const deploymentMergedExpected = {
@@ -708,7 +695,6 @@ describe('Indexing rules', () => {
708695
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
709696
requireSupported: false,
710697
safety: true,
711-
protocolNetwork: 'eip155:421614',
712698
}
713699

714700
// Write the orginals

0 commit comments

Comments
 (0)