(height: number)
| 114 | } |
| 115 | |
| 116 | async getBlockTimestamp(height: number): Promise<Date> { |
| 117 | const block = await getBlockByHeight(this.apiService.api, height); |
| 118 | |
| 119 | let timestamp = getTimestamp(block); |
| 120 | if (!timestamp) { |
| 121 | // Not all networks have a block timestamp, e.g. Shiden |
| 122 | const blockTimestamp = await ( |
| 123 | await this.apiService.unsafeApi.at(block.hash) |
| 124 | ).query.timestamp.now(); |
| 125 | |
| 126 | timestamp = new Date(blockTimestamp.toNumber()); |
| 127 | } |
| 128 | |
| 129 | return timestamp; |
| 130 | } |
| 131 | |
| 132 | getBlockSize(block: IBlock): number { |
| 133 | return getBlockSize(block); |
nothing calls this directly
no test coverage detected