( api: ApiPromise, hashs: BlockHash[], )
| 380 | } |
| 381 | |
| 382 | export 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 | |
| 396 | export async function fetchBlocksBatches( |
| 397 | api: ApiPromise, |
no test coverage detected