MCPcopy Create free account
hub / github.com/subquery/subql / fetchBlocks

Method fetchBlocks

packages/node/src/blockchain.service.ts:73–86  ·  view source on GitHub ↗
(
    blockNums: number[],
  )

Source from the content-addressed store, hash-verified

71
72 @mainThreadOnly()
73 async fetchBlocks(
74 blockNums: number[],
75 ): Promise<IBlock<BlockContent>[] | IBlock<LightBlockContent>[]> {
76 const specChanged = await this.runtimeService.specChanged(
77 blockNums[blockNums.length - 1],
78 );
79
80 // If specVersion not changed, a known overallSpecVer will be pass in
81 // Otherwise use api to fetch runtimes
82 return this.apiService.fetchBlocks(
83 blockNums,
84 specChanged ? undefined : this.runtimeService.parentSpecVersion,
85 );
86 }
87
88 async fetchBlockWorker(
89 worker: IIndexerWorker,

Callers

nothing calls this directly

Calls 2

specChangedMethod · 0.80
fetchBlocksMethod · 0.65

Tested by

no test coverage detected