MCPcopy
hub / github.com/subquery/subql / enableDictionary

Function enableDictionary

packages/node-core/src/indexer/fetch.service.spec.ts:298–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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([

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected