( api: ApiPromise, hashs: BlockHash[], )
| 364 | } |
| 365 | |
| 366 | export 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 | |
| 382 | export async function fetchRuntimeVersionRange( |
| 383 | api: ApiPromise, |
no test coverage detected