| 296 | }); |
| 297 | |
| 298 | const enableDictionary = () => { |
| 299 | // Mock the remainder of dictionary service so it works |
| 300 | (dictionaryService as any).useDictionary = () => jest.fn(() => true); |
| 301 | // dictionaryService.queriesMap = new BlockHeightMap(new Map([[1, [{entity: 'mock', conditions: []}]]])); |
| 302 | (dictionaryService as any).getDictionary = () => |
| 303 | jest.fn(() => { |
| 304 | return { |
| 305 | queryMapValidByHeight: () => true, |
| 306 | startHeight: 1, |
| 307 | getQueryEndBlock: () => 1000, |
| 308 | }; |
| 309 | }); |
| 310 | dictionaryService.scopedDictionaryEntries = (start, end, batch) => { |
| 311 | return Promise.resolve({ |
| 312 | batchBlocks: [2, 4, 6, 8, 10], |
| 313 | queryEndBlock: end, |
| 314 | _metadata: { |
| 315 | lastProcessedHeight: 1000, |
| 316 | }, |
| 317 | |
| 318 | lastBufferedHeight: 1000, |
| 319 | }); |
| 320 | }; |
| 321 | }; |
| 322 | |
| 323 | const moduloBlockHeightMap = new BlockHeightMap( |
| 324 | new Map([ |