@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.
Files changed (3) hide show
  1. package/index.js +18 -17
  2. package/index.js.map +1 -1
  3. 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.create({ ...Header.empty(), timeSlotIndex: slot });
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 epochMarker = epoch_mark ?? null;
11097
- const ticketsMarker = tickets_mark === undefined || tickets_mark === null
11098
- ? null
11099
- : TicketsMarker.create({ tickets: opaque_asOpaqueType(tickets_mark) });
11100
- return header_Header.create({
11101
- parentHeaderHash: parent,
11102
- priorStateRoot: parent_state_root,
11103
- extrinsicHash: extrinsic_hash,
11104
- timeSlotIndex: slot,
11105
- epochMarker,
11106
- ticketsMarker,
11107
- offendersMarker: offenders_mark,
11108
- bandersnatchBlockAuthorIndex: author_index,
11109
- entropySource: entropy_source,
11110
- seal,
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