@typeberry/convert 0.5.0-3439612 → 0.5.0-4da816c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +18 -17
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10310,6 +10310,7 @@ class header_Header extends WithDebug {
|
|
|
10310
10310
|
static create(h) {
|
|
10311
10311
|
return Object.assign(header_Header.empty(), h);
|
|
10312
10312
|
}
|
|
10313
|
+
// TODO [ToDr] the fields should be readonly
|
|
10313
10314
|
/**
|
|
10314
10315
|
* `H_p`: Hash of the parent header.
|
|
10315
10316
|
*
|
|
@@ -10496,7 +10497,8 @@ class Block extends WithDebug {
|
|
|
10496
10497
|
}
|
|
10497
10498
|
}
|
|
10498
10499
|
function emptyBlock(slot = tryAsTimeSlot(0)) {
|
|
10499
|
-
const header = Header.
|
|
10500
|
+
const header = Header.empty();
|
|
10501
|
+
header.timeSlotIndex = slot;
|
|
10500
10502
|
return Block.create({
|
|
10501
10503
|
header,
|
|
10502
10504
|
extrinsic: Extrinsic.create({
|
|
@@ -11093,22 +11095,21 @@ const headerFromJson = json.object({
|
|
|
11093
11095
|
entropy_source: bandersnatchVrfSignature,
|
|
11094
11096
|
seal: bandersnatchVrfSignature,
|
|
11095
11097
|
}, ({ parent, parent_state_root, extrinsic_hash, slot, epoch_mark, tickets_mark, offenders_mark, author_index, entropy_source, seal, }) => {
|
|
11096
|
-
const
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
});
|
|
11098
|
+
const header = header_Header.empty();
|
|
11099
|
+
header.parentHeaderHash = parent;
|
|
11100
|
+
header.priorStateRoot = parent_state_root;
|
|
11101
|
+
header.extrinsicHash = extrinsic_hash;
|
|
11102
|
+
header.timeSlotIndex = slot;
|
|
11103
|
+
header.epochMarker = epoch_mark ?? null;
|
|
11104
|
+
header.ticketsMarker =
|
|
11105
|
+
tickets_mark === undefined || tickets_mark === null
|
|
11106
|
+
? null
|
|
11107
|
+
: TicketsMarker.create({ tickets: opaque_asOpaqueType(tickets_mark) });
|
|
11108
|
+
header.offendersMarker = offenders_mark;
|
|
11109
|
+
header.bandersnatchBlockAuthorIndex = author_index;
|
|
11110
|
+
header.entropySource = entropy_source;
|
|
11111
|
+
header.seal = seal;
|
|
11112
|
+
return header;
|
|
11112
11113
|
});
|
|
11113
11114
|
|
|
11114
11115
|
;// CONCATENATED MODULE: ./packages/jam/block-json/block.ts
|