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

Function substrateBlockToHeader

packages/node/src/utils/substrate.ts:52–63  ·  view source on GitHub ↗
(block: SignedBlock)

Source from the content-addressed store, hash-verified

50}
51
52export function substrateBlockToHeader(block: SignedBlock): Header {
53 const timestamp = getTimestamp(block);
54 assert(
55 timestamp,
56 'Failed to retrieve a reliable timestamp. This issue is more likely to occur on networks like Shiden',
57 );
58
59 return {
60 ...substrateHeaderToHeader(block.block.header),
61 timestamp,
62 };
63}
64
65export function wrapBlock(
66 signedBlock: SignedBlock,

Callers 2

getHeaderForHashFunction · 0.85
fetchBlocksBatchesFunction · 0.85

Calls 2

getTimestampFunction · 0.85
substrateHeaderToHeaderFunction · 0.85

Tested by

no test coverage detected