File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
packages/indexer-common/src/indexer-management Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ export interface IndexingRuleAttributes {
30
30
decisionBasis : IndexingDecisionBasis
31
31
requireSupported : boolean
32
32
safety : boolean
33
+
34
+ // TODO: deprecate
33
35
protocolNetwork : string
34
36
}
35
37
Original file line number Diff line number Diff line change 9
9
import { IndexerManagementDefaults , IndexerManagementResolverContext } from '../client'
10
10
import { Transaction } from 'sequelize/types'
11
11
import { fetchIndexingRules } from '../rules'
12
- import { processIdentifier } from '../../'
12
+ import { processIdentifier , validateNetworkIdentifier } from '../../'
13
13
import groupBy from 'lodash.groupby'
14
14
15
15
const resetGlobalRule = async (
@@ -73,7 +73,17 @@ export default {
73
73
throw Error ( 'Cannot set indexingRule without identifier' )
74
74
}
75
75
76
- rule . protocolNetwork = network . networkMonitor . networkCAIPID
76
+ if (
77
+ rule . protocolNetwork &&
78
+ validateNetworkIdentifier ( rule . protocolNetwork ) !==
79
+ network . specification . networkIdentifier
80
+ ) {
81
+ throw Error (
82
+ `Cannot set indexingRule for a different network (${ rule . protocolNetwork } ) than configured ${ network . specification . networkIdentifier } ` ,
83
+ )
84
+ }
85
+
86
+ rule . protocolNetwork = network . specification . networkIdentifier
77
87
78
88
const [ identifier ] = await processIdentifier ( rule . identifier , {
79
89
all : false ,
You can’t perform that action at this time.
0 commit comments