Skip to content

Commit 7879092

Browse files
committed
fix: mock
1 parent d7866ca commit 7879092

File tree

1 file changed

+13
-0
lines changed
  • packages/indexer-common/src/indexing-fees/__tests__

1 file changed

+13
-0
lines changed

packages/indexer-common/src/indexing-fees/__tests__/dips.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from '@graphprotocol/common-ts'
2121
import { Sequelize } from 'sequelize'
2222
import { testNetworkSpecification } from '../../indexer-management/__tests__/util'
23+
import { BigNumber } from 'ethers'
2324

2425
// Make global Jest variables available
2526
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -243,6 +244,18 @@ describe('DipsManager', () => {
243244
})
244245

245246
test('creates indexing rules for active agreements', async () => {
247+
248+
// Mock fetch the subgraph deployment from the network subgraph
249+
network.networkMonitor.subgraphDeployment = jest.fn().mockResolvedValue({
250+
id: testDeploymentId,
251+
ipfsHash: testDeploymentId,
252+
deniedAt: null,
253+
stakedTokens: BigNumber.from('1000'),
254+
signalledTokens: BigNumber.from('1000'),
255+
queryFeesAmount: BigNumber.from('0'),
256+
protocolNetwork: 'arbitrum-one',
257+
})
258+
246259
await dipsManager.ensureAgreementRules()
247260

248261
const rules = await managementModels.IndexingRule.findAll({

0 commit comments

Comments
 (0)