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

Function fetchRuntimeVersionRange

packages/node/src/utils/substrate.ts:382–394  ·  view source on GitHub ↗
(
  api: ApiPromise,
  hashs: BlockHash[],
)

Source from the content-addressed store, hash-verified

380}
381
382export async function fetchRuntimeVersionRange(
383 api: ApiPromise,
384 hashs: BlockHash[],
385): Promise<RuntimeVersion[]> {
386 return Promise.all(
387 hashs.map((hash) =>
388 api.rpc.state.getRuntimeVersion(hash).catch((e) => {
389 logger.error(`failed to fetch RuntimeVersion at block ${hash}`);
390 throw ApiPromiseConnection.handleError(e);
391 }),
392 ),
393 );
394}
395
396export async function fetchBlocksBatches(
397 api: ApiPromise,

Callers 1

fetchBlocksBatchesFunction · 0.85

Calls 3

mapMethod · 0.80
handleErrorMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected