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

Function fetchEventsRange

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

Source from the content-addressed store, hash-verified

364}
365
366export async function fetchEventsRange(
367 api: ApiPromise,
368 hashs: BlockHash[],
369): Promise<Vec<EventRecord>[]> {
370 return Promise.all(
371 hashs.map((hash) =>
372 api.query.system.events.at(hash).catch((e) => {
373 logger.error(
374 `failed to fetch events at block ${hash}${getApiDecodeErrMsg(e.message)}`,
375 );
376 throw ApiPromiseConnection.handleError(e);
377 }),
378 ),
379 );
380}
381
382export async function fetchRuntimeVersionRange(
383 api: ApiPromise,

Callers 1

fetchBlocksBatchesFunction · 0.85

Calls 4

getApiDecodeErrMsgFunction · 0.85
mapMethod · 0.80
handleErrorMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected