( api: ApiPromise, blockHash: string, )
| 99 | } |
| 100 | |
| 101 | export async function getHeaderForHash( |
| 102 | api: ApiPromise, |
| 103 | blockHash: string, |
| 104 | ): Promise<Header> { |
| 105 | const block = await api.rpc.chain.getBlock(blockHash).catch((e) => { |
| 106 | logger.error( |
| 107 | `failed to fetch Block hash="${blockHash}" ${getApiDecodeErrMsg(e.message)}`, |
| 108 | ); |
| 109 | throw ApiPromiseConnection.handleError(e); |
| 110 | }); |
| 111 | |
| 112 | return substrateBlockToHeader(block); |
| 113 | } |
| 114 | |
| 115 | export function wrapExtrinsics( |
| 116 | wrappedBlock: SubstrateBlock, |
no test coverage detected