@typeberry/lib 0.0.1-f0ab5f1 → 0.0.2-5755578

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.d.ts +38 -13
  2. package/index.js +24 -7
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -60,7 +60,7 @@ declare namespace index$s {
60
60
 
61
61
  declare enum GpVersion {
62
62
  V0_6_7 = "0.6.7",
63
- V0_7_0 = "0.7.0-preview",
63
+ V0_7_0 = "0.7.0",
64
64
  V0_7_1 = "0.7.1-preview",
65
65
  }
66
66
 
@@ -74,7 +74,7 @@ declare const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
74
74
  declare const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
75
75
 
76
76
  declare const env = typeof process === "undefined" ? {} : process.env;
77
- declare const DEFAULT_VERSION = GpVersion.V0_6_7;
77
+ declare const DEFAULT_VERSION = GpVersion.V0_7_0;
78
78
  declare let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
79
79
  declare let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
80
80
 
@@ -6548,6 +6548,22 @@ declare class ValidatorKeys extends WithDebug {
6548
6548
  }
6549
6549
  }
6550
6550
 
6551
+ declare class TicketsMarker extends WithDebug {
6552
+ static Codec = codec.Class(TicketsMarker, {
6553
+ tickets: codecPerEpochBlock(Ticket.Codec),
6554
+ });
6555
+
6556
+ static create({ tickets }: CodecRecord<TicketsMarker>) {
6557
+ return new TicketsMarker(tickets);
6558
+ }
6559
+
6560
+ private constructor(public readonly tickets: PerEpochBlock<Ticket>) {
6561
+ super();
6562
+ }
6563
+ }
6564
+
6565
+ type TicketsMarkerView = DescribedBy<typeof TicketsMarker.Codec.View>;
6566
+
6551
6567
  /**
6552
6568
  * For the first block in a new epoch, the epoch marker is set
6553
6569
  * and contains the epoch randomness and validator keys
@@ -6578,6 +6594,8 @@ declare class EpochMarker extends WithDebug {
6578
6594
  }
6579
6595
  }
6580
6596
 
6597
+ type EpochMarkerView = DescribedBy<typeof EpochMarker.Codec.View>;
6598
+
6581
6599
  /**
6582
6600
  * Return an encoded header without the seal components.
6583
6601
  *
@@ -6600,7 +6618,7 @@ declare const legacyDescriptor = {
6600
6618
  extrinsicHash: codec.bytes(HASH_SIZE).asOpaque<ExtrinsicHash>(),
6601
6619
  timeSlotIndex: codec.u32.asOpaque<TimeSlot>(),
6602
6620
  epochMarker: codec.optional(EpochMarker.Codec),
6603
- ticketsMarker: codec.optional(codecPerEpochBlock(Ticket.Codec)),
6621
+ ticketsMarker: codec.optional(TicketsMarker.Codec),
6604
6622
  offendersMarker: codec.sequenceVarLen(codec.bytes(ED25519_KEY_BYTES).asOpaque<Ed25519Key>()),
6605
6623
  bandersnatchBlockAuthorIndex: codec.u16.asOpaque<ValidatorIndex>(),
6606
6624
  entropySource: codec.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque<BandersnatchVrfSignature>(),
@@ -6623,7 +6641,7 @@ declare class Header extends WithDebug {
6623
6641
  extrinsicHash: codec.bytes(HASH_SIZE).asOpaque<ExtrinsicHash>(),
6624
6642
  timeSlotIndex: codec.u32.asOpaque<TimeSlot>(),
6625
6643
  epochMarker: codec.optional(EpochMarker.Codec),
6626
- ticketsMarker: codec.optional(codecPerEpochBlock(Ticket.Codec)),
6644
+ ticketsMarker: codec.optional(TicketsMarker.Codec),
6627
6645
  bandersnatchBlockAuthorIndex: codec.u16.asOpaque<ValidatorIndex>(),
6628
6646
  entropySource: codec.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque<BandersnatchVrfSignature>(),
6629
6647
  offendersMarker: codec.sequenceVarLen(codec.bytes(ED25519_KEY_BYTES).asOpaque<Ed25519Key>()),
@@ -6656,7 +6674,7 @@ declare class Header extends WithDebug {
6656
6674
  * `H_w`: Winning tickets provides the series of 600 slot sealing "tickets"
6657
6675
  * for the next epoch.
6658
6676
  */
6659
- public ticketsMarker: PerEpochBlock<Ticket> | null = null;
6677
+ public ticketsMarker: TicketsMarker | null = null;
6660
6678
  /** `H_i`: Block author's index in the current validator set. */
6661
6679
  public bandersnatchBlockAuthorIndex: ValidatorIndex = tryAsValidatorIndex(0);
6662
6680
  /** `H_v`: Entropy-yielding VRF signature. */
@@ -6841,6 +6859,7 @@ type index$j_EntropyHash = EntropyHash;
6841
6859
  type index$j_Epoch = Epoch;
6842
6860
  type index$j_EpochMarker = EpochMarker;
6843
6861
  declare const index$j_EpochMarker: typeof EpochMarker;
6862
+ type index$j_EpochMarkerView = EpochMarkerView;
6844
6863
  type index$j_Extrinsic = Extrinsic;
6845
6864
  declare const index$j_Extrinsic: typeof Extrinsic;
6846
6865
  type index$j_ExtrinsicHash = ExtrinsicHash;
@@ -6860,6 +6879,9 @@ type index$j_SegmentIndex = SegmentIndex;
6860
6879
  type index$j_ServiceGas = ServiceGas;
6861
6880
  type index$j_ServiceId = ServiceId;
6862
6881
  type index$j_StateRootHash = StateRootHash;
6882
+ type index$j_TicketsMarker = TicketsMarker;
6883
+ declare const index$j_TicketsMarker: typeof TicketsMarker;
6884
+ type index$j_TicketsMarkerView = TicketsMarkerView;
6863
6885
  type index$j_TimeSlot = TimeSlot;
6864
6886
  type index$j_ValidatorIndex = ValidatorIndex;
6865
6887
  type index$j_ValidatorKeys = ValidatorKeys;
@@ -6892,8 +6914,8 @@ declare const index$j_workPackage: typeof workPackage;
6892
6914
  declare const index$j_workReport: typeof workReport;
6893
6915
  declare const index$j_workResult: typeof workResult;
6894
6916
  declare namespace index$j {
6895
- export { index$j_Block as Block, index$j_EpochMarker as EpochMarker, index$j_Extrinsic as Extrinsic, index$j_Header as Header, index$j_HeaderViewWithHash as HeaderViewWithHash, index$j_MAX_NUMBER_OF_SEGMENTS as MAX_NUMBER_OF_SEGMENTS, index$j_ValidatorKeys as ValidatorKeys, index$j_W_E as W_E, index$j_W_S as W_S, index$j_assurances as assurances, index$j_codecPerEpochBlock as codecPerEpochBlock, index$j_codecPerValidator as codecPerValidator, codec as codecUtils, index$j_disputes as disputes, index$j_encodeUnsealedHeader as encodeUnsealedHeader, index$j_guarantees as guarantees, index$j_headerViewWithHashCodec as headerViewWithHashCodec, index$j_legacyDescriptor as legacyDescriptor, index$j_preimage as preimage, index$j_refineContext as refineContext, index$j_tickets as tickets, index$j_tryAsCoreIndex as tryAsCoreIndex, index$j_tryAsEpoch as tryAsEpoch, index$j_tryAsPerEpochBlock as tryAsPerEpochBlock, index$j_tryAsPerValidator as tryAsPerValidator, index$j_tryAsSegmentIndex as tryAsSegmentIndex, index$j_tryAsServiceGas as tryAsServiceGas, index$j_tryAsServiceId as tryAsServiceId, index$j_tryAsTimeSlot as tryAsTimeSlot, index$j_tryAsValidatorIndex as tryAsValidatorIndex, index$j_workItem as workItem, index$j_workPackage as workPackage, index$j_workReport as workReport, index$j_workResult as workResult };
6896
- export type { index$j_BlockView as BlockView, index$j_CodeHash as CodeHash, index$j_CoreIndex as CoreIndex, index$j_EntropyHash as EntropyHash, index$j_Epoch as Epoch, index$j_ExtrinsicHash as ExtrinsicHash, index$j_ExtrinsicView as ExtrinsicView, index$j_HeaderHash as HeaderHash, index$j_HeaderView as HeaderView, index$j_PerEpochBlock as PerEpochBlock, index$j_PerValidator as PerValidator, index$j_SEGMENT_BYTES as SEGMENT_BYTES, index$j_Segment as Segment, index$j_SegmentIndex as SegmentIndex, index$j_ServiceGas as ServiceGas, index$j_ServiceId as ServiceId, index$j_StateRootHash as StateRootHash, index$j_TimeSlot as TimeSlot, index$j_ValidatorIndex as ValidatorIndex, index$j_WorkReportHash as WorkReportHash };
6917
+ export { index$j_Block as Block, index$j_EpochMarker as EpochMarker, index$j_Extrinsic as Extrinsic, index$j_Header as Header, index$j_HeaderViewWithHash as HeaderViewWithHash, index$j_MAX_NUMBER_OF_SEGMENTS as MAX_NUMBER_OF_SEGMENTS, index$j_TicketsMarker as TicketsMarker, index$j_ValidatorKeys as ValidatorKeys, index$j_W_E as W_E, index$j_W_S as W_S, index$j_assurances as assurances, index$j_codecPerEpochBlock as codecPerEpochBlock, index$j_codecPerValidator as codecPerValidator, codec as codecUtils, index$j_disputes as disputes, index$j_encodeUnsealedHeader as encodeUnsealedHeader, index$j_guarantees as guarantees, index$j_headerViewWithHashCodec as headerViewWithHashCodec, index$j_legacyDescriptor as legacyDescriptor, index$j_preimage as preimage, index$j_refineContext as refineContext, index$j_tickets as tickets, index$j_tryAsCoreIndex as tryAsCoreIndex, index$j_tryAsEpoch as tryAsEpoch, index$j_tryAsPerEpochBlock as tryAsPerEpochBlock, index$j_tryAsPerValidator as tryAsPerValidator, index$j_tryAsSegmentIndex as tryAsSegmentIndex, index$j_tryAsServiceGas as tryAsServiceGas, index$j_tryAsServiceId as tryAsServiceId, index$j_tryAsTimeSlot as tryAsTimeSlot, index$j_tryAsValidatorIndex as tryAsValidatorIndex, index$j_workItem as workItem, index$j_workPackage as workPackage, index$j_workReport as workReport, index$j_workResult as workResult };
6918
+ export type { index$j_BlockView as BlockView, index$j_CodeHash as CodeHash, index$j_CoreIndex as CoreIndex, index$j_EntropyHash as EntropyHash, index$j_Epoch as Epoch, index$j_EpochMarkerView as EpochMarkerView, index$j_ExtrinsicHash as ExtrinsicHash, index$j_ExtrinsicView as ExtrinsicView, index$j_HeaderHash as HeaderHash, index$j_HeaderView as HeaderView, index$j_PerEpochBlock as PerEpochBlock, index$j_PerValidator as PerValidator, index$j_SEGMENT_BYTES as SEGMENT_BYTES, index$j_Segment as Segment, index$j_SegmentIndex as SegmentIndex, index$j_ServiceGas as ServiceGas, index$j_ServiceId as ServiceId, index$j_StateRootHash as StateRootHash, index$j_TicketsMarkerView as TicketsMarkerView, index$j_TimeSlot as TimeSlot, index$j_ValidatorIndex as ValidatorIndex, index$j_WorkReportHash as WorkReportHash };
6897
6919
  }
6898
6920
 
6899
6921
  /** A type that can be read from a JSON-parsed object. */
@@ -7635,7 +7657,7 @@ declare const epochMark = json.object<JsonEpochMarker, EpochMarker>(
7635
7657
  (x) => EpochMarker.create({ entropy: x.entropy, ticketsEntropy: x.tickets_entropy, validators: x.validators }),
7636
7658
  );
7637
7659
 
7638
- declare const ticketsMark = json.object<Ticket>(
7660
+ declare const ticket = json.object<Ticket>(
7639
7661
  {
7640
7662
  id: fromJson.bytes32(),
7641
7663
  attempt: fromJson.ticketAttempt,
@@ -7649,7 +7671,7 @@ type JsonHeader = {
7649
7671
  extrinsic_hash: ExtrinsicHash;
7650
7672
  slot: TimeSlot;
7651
7673
  epoch_mark?: EpochMarker;
7652
- tickets_mark?: KnownSizeArray<Ticket, "EpochLength">;
7674
+ tickets_mark?: Ticket[];
7653
7675
  offenders_mark: Ed25519Key[];
7654
7676
  author_index: ValidatorIndex;
7655
7677
  entropy_source: BandersnatchVrfSignature;
@@ -7663,7 +7685,7 @@ declare const headerFromJson = json.object<JsonHeader, Header>(
7663
7685
  extrinsic_hash: fromJson.bytes32(),
7664
7686
  slot: "number",
7665
7687
  epoch_mark: json.optional(epochMark),
7666
- tickets_mark: json.optional<Ticket[]>(json.array(ticketsMark)),
7688
+ tickets_mark: json.optional(json.array(ticket)),
7667
7689
  offenders_mark: json.array(fromJson.bytes32<Ed25519Key>()),
7668
7690
  author_index: "number",
7669
7691
  entropy_source: bandersnatchVrfSignature,
@@ -7687,7 +7709,10 @@ declare const headerFromJson = json.object<JsonHeader, Header>(
7687
7709
  header.extrinsicHash = extrinsic_hash;
7688
7710
  header.timeSlotIndex = slot;
7689
7711
  header.epochMarker = epoch_mark ?? null;
7690
- header.ticketsMarker = tickets_mark ?? null;
7712
+ header.ticketsMarker =
7713
+ tickets_mark === undefined || tickets_mark === null
7714
+ ? null
7715
+ : TicketsMarker.create({ tickets: asOpaqueType(tickets_mark) });
7691
7716
  header.offendersMarker = offenders_mark;
7692
7717
  header.bandersnatchBlockAuthorIndex = author_index;
7693
7718
  header.entropySource = entropy_source;
@@ -7737,9 +7762,9 @@ declare const index$h_preimagesExtrinsicFromJson: typeof preimagesExtrinsicFromJ
7737
7762
  declare const index$h_refineContextFromJson: typeof refineContextFromJson;
7738
7763
  declare const index$h_reportGuaranteeFromJson: typeof reportGuaranteeFromJson;
7739
7764
  declare const index$h_segmentRootLookupItemFromJson: typeof segmentRootLookupItemFromJson;
7765
+ declare const index$h_ticket: typeof ticket;
7740
7766
  declare const index$h_ticketEnvelopeFromJson: typeof ticketEnvelopeFromJson;
7741
7767
  declare const index$h_ticketsExtrinsicFromJson: typeof ticketsExtrinsicFromJson;
7742
- declare const index$h_ticketsMark: typeof ticketsMark;
7743
7768
  declare const index$h_validatorKeysFromJson: typeof validatorKeysFromJson;
7744
7769
  declare const index$h_validatorSignatureFromJson: typeof validatorSignatureFromJson;
7745
7770
  declare const index$h_verdictFromJson: typeof verdictFromJson;
@@ -7749,7 +7774,7 @@ declare const index$h_workRefineLoadFromJson: typeof workRefineLoadFromJson;
7749
7774
  declare const index$h_workReportFromJson: typeof workReportFromJson;
7750
7775
  declare const index$h_workResultFromJson: typeof workResultFromJson;
7751
7776
  declare namespace index$h {
7752
- export { index$h_bandersnatchVrfSignature as bandersnatchVrfSignature, index$h_blockFromJson as blockFromJson, index$h_culpritFromJson as culpritFromJson, index$h_disputesExtrinsicFromJson as disputesExtrinsicFromJson, index$h_epochMark as epochMark, index$h_faultFromJson as faultFromJson, index$h_fromJson as fromJson, index$h_getAssurancesExtrinsicFromJson as getAssurancesExtrinsicFromJson, index$h_getAvailabilityAssuranceFromJson as getAvailabilityAssuranceFromJson, index$h_getExtrinsicFromJson as getExtrinsicFromJson, index$h_guaranteesExtrinsicFromJson as guaranteesExtrinsicFromJson, index$h_headerFromJson as headerFromJson, index$h_judgementFromJson as judgementFromJson, index$h_preimageFromJson as preimageFromJson, index$h_preimagesExtrinsicFromJson as preimagesExtrinsicFromJson, index$h_refineContextFromJson as refineContextFromJson, index$h_reportGuaranteeFromJson as reportGuaranteeFromJson, index$h_segmentRootLookupItemFromJson as segmentRootLookupItemFromJson, index$h_ticketEnvelopeFromJson as ticketEnvelopeFromJson, index$h_ticketsExtrinsicFromJson as ticketsExtrinsicFromJson, index$h_ticketsMark as ticketsMark, index$h_validatorKeysFromJson as validatorKeysFromJson, index$h_validatorSignatureFromJson as validatorSignatureFromJson, index$h_verdictFromJson as verdictFromJson, index$h_workExecResultFromJson as workExecResultFromJson, index$h_workPackageSpecFromJson as workPackageSpecFromJson, index$h_workRefineLoadFromJson as workRefineLoadFromJson, index$h_workReportFromJson as workReportFromJson, index$h_workResultFromJson as workResultFromJson };
7777
+ export { index$h_bandersnatchVrfSignature as bandersnatchVrfSignature, index$h_blockFromJson as blockFromJson, index$h_culpritFromJson as culpritFromJson, index$h_disputesExtrinsicFromJson as disputesExtrinsicFromJson, index$h_epochMark as epochMark, index$h_faultFromJson as faultFromJson, index$h_fromJson as fromJson, index$h_getAssurancesExtrinsicFromJson as getAssurancesExtrinsicFromJson, index$h_getAvailabilityAssuranceFromJson as getAvailabilityAssuranceFromJson, index$h_getExtrinsicFromJson as getExtrinsicFromJson, index$h_guaranteesExtrinsicFromJson as guaranteesExtrinsicFromJson, index$h_headerFromJson as headerFromJson, index$h_judgementFromJson as judgementFromJson, index$h_preimageFromJson as preimageFromJson, index$h_preimagesExtrinsicFromJson as preimagesExtrinsicFromJson, index$h_refineContextFromJson as refineContextFromJson, index$h_reportGuaranteeFromJson as reportGuaranteeFromJson, index$h_segmentRootLookupItemFromJson as segmentRootLookupItemFromJson, index$h_ticket as ticket, index$h_ticketEnvelopeFromJson as ticketEnvelopeFromJson, index$h_ticketsExtrinsicFromJson as ticketsExtrinsicFromJson, index$h_validatorKeysFromJson as validatorKeysFromJson, index$h_validatorSignatureFromJson as validatorSignatureFromJson, index$h_verdictFromJson as verdictFromJson, index$h_workExecResultFromJson as workExecResultFromJson, index$h_workPackageSpecFromJson as workPackageSpecFromJson, index$h_workRefineLoadFromJson as workRefineLoadFromJson, index$h_workReportFromJson as workReportFromJson, index$h_workResultFromJson as workResultFromJson };
7753
7778
  export type { index$h_CamelToSnake as CamelToSnake, index$h_JsonCulprit as JsonCulprit, index$h_JsonEpochMarker as JsonEpochMarker, index$h_JsonFault as JsonFault, index$h_JsonHeader as JsonHeader, index$h_JsonJudgement as JsonJudgement, index$h_JsonObject as JsonObject, index$h_JsonRefineContext as JsonRefineContext, index$h_JsonReportGuarantee as JsonReportGuarantee, index$h_JsonVerdict as JsonVerdict, index$h_JsonWorkExecResult as JsonWorkExecResult, index$h_JsonWorkRefineLoad as JsonWorkRefineLoad, index$h_JsonWorkReport as JsonWorkReport, index$h_JsonWorkResult as JsonWorkResult };
7754
7779
  }
7755
7780
 
package/index.js CHANGED
@@ -52,7 +52,7 @@ var index$s = /*#__PURE__*/Object.freeze({
52
52
  var GpVersion;
53
53
  (function (GpVersion) {
54
54
  GpVersion["V0_6_7"] = "0.6.7";
55
- GpVersion["V0_7_0"] = "0.7.0-preview";
55
+ GpVersion["V0_7_0"] = "0.7.0";
56
56
  GpVersion["V0_7_1"] = "0.7.1-preview";
57
57
  })(GpVersion || (GpVersion = {}));
58
58
  var TestSuite;
@@ -63,7 +63,7 @@ var TestSuite;
63
63
  const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
64
64
  const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
65
65
  const env = typeof process === "undefined" ? {} : process.env;
66
- const DEFAULT_VERSION = GpVersion.V0_6_7;
66
+ const DEFAULT_VERSION = GpVersion.V0_7_0;
67
67
  let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
68
68
  let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
69
69
  function parseCurrentVersion(env) {
@@ -6944,6 +6944,19 @@ class ValidatorKeys extends WithDebug {
6944
6944
  this.ed25519 = ed25519;
6945
6945
  }
6946
6946
  }
6947
+ class TicketsMarker extends WithDebug {
6948
+ tickets;
6949
+ static Codec = codec$1.Class(TicketsMarker, {
6950
+ tickets: codecPerEpochBlock(Ticket.Codec),
6951
+ });
6952
+ static create({ tickets }) {
6953
+ return new TicketsMarker(tickets);
6954
+ }
6955
+ constructor(tickets) {
6956
+ super();
6957
+ this.tickets = tickets;
6958
+ }
6959
+ }
6947
6960
  /**
6948
6961
  * For the first block in a new epoch, the epoch marker is set
6949
6962
  * and contains the epoch randomness and validator keys
@@ -6997,7 +7010,7 @@ const legacyDescriptor = {
6997
7010
  extrinsicHash: codec$1.bytes(HASH_SIZE).asOpaque(),
6998
7011
  timeSlotIndex: codec$1.u32.asOpaque(),
6999
7012
  epochMarker: codec$1.optional(EpochMarker.Codec),
7000
- ticketsMarker: codec$1.optional(codecPerEpochBlock(Ticket.Codec)),
7013
+ ticketsMarker: codec$1.optional(TicketsMarker.Codec),
7001
7014
  offendersMarker: codec$1.sequenceVarLen(codec$1.bytes(ED25519_KEY_BYTES).asOpaque()),
7002
7015
  bandersnatchBlockAuthorIndex: codec$1.u16.asOpaque(),
7003
7016
  entropySource: codec$1.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque(),
@@ -7017,7 +7030,7 @@ class Header extends WithDebug {
7017
7030
  extrinsicHash: codec$1.bytes(HASH_SIZE).asOpaque(),
7018
7031
  timeSlotIndex: codec$1.u32.asOpaque(),
7019
7032
  epochMarker: codec$1.optional(EpochMarker.Codec),
7020
- ticketsMarker: codec$1.optional(codecPerEpochBlock(Ticket.Codec)),
7033
+ ticketsMarker: codec$1.optional(TicketsMarker.Codec),
7021
7034
  bandersnatchBlockAuthorIndex: codec$1.u16.asOpaque(),
7022
7035
  entropySource: codec$1.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque(),
7023
7036
  offendersMarker: codec$1.sequenceVarLen(codec$1.bytes(ED25519_KEY_BYTES).asOpaque()),
@@ -7212,6 +7225,7 @@ var index$j = /*#__PURE__*/Object.freeze({
7212
7225
  Header: Header,
7213
7226
  MAX_NUMBER_OF_SEGMENTS: MAX_NUMBER_OF_SEGMENTS,
7214
7227
  SEGMENT_BYTES: SEGMENT_BYTES,
7228
+ TicketsMarker: TicketsMarker,
7215
7229
  ValidatorKeys: ValidatorKeys,
7216
7230
  assurances: assurances,
7217
7231
  codecPerEpochBlock: codecPerEpochBlock,
@@ -7690,7 +7704,7 @@ const epochMark = json.object({
7690
7704
  tickets_entropy: fromJson.bytes32(),
7691
7705
  validators: json.array(validatorKeysFromJson),
7692
7706
  }, (x) => EpochMarker.create({ entropy: x.entropy, ticketsEntropy: x.tickets_entropy, validators: x.validators }));
7693
- const ticketsMark = json.object({
7707
+ const ticket = json.object({
7694
7708
  id: fromJson.bytes32(),
7695
7709
  attempt: fromJson.ticketAttempt,
7696
7710
  }, (x) => Ticket.create({ id: x.id, attempt: x.attempt }));
@@ -7700,7 +7714,7 @@ const headerFromJson = json.object({
7700
7714
  extrinsic_hash: fromJson.bytes32(),
7701
7715
  slot: "number",
7702
7716
  epoch_mark: json.optional(epochMark),
7703
- tickets_mark: json.optional(json.array(ticketsMark)),
7717
+ tickets_mark: json.optional(json.array(ticket)),
7704
7718
  offenders_mark: json.array(fromJson.bytes32()),
7705
7719
  author_index: "number",
7706
7720
  entropy_source: bandersnatchVrfSignature,
@@ -7712,7 +7726,10 @@ const headerFromJson = json.object({
7712
7726
  header.extrinsicHash = extrinsic_hash;
7713
7727
  header.timeSlotIndex = slot;
7714
7728
  header.epochMarker = epoch_mark ?? null;
7715
- header.ticketsMarker = tickets_mark ?? null;
7729
+ header.ticketsMarker =
7730
+ tickets_mark === undefined || tickets_mark === null
7731
+ ? null
7732
+ : TicketsMarker.create({ tickets: asOpaqueType(tickets_mark) });
7716
7733
  header.offendersMarker = offenders_mark;
7717
7734
  header.bandersnatchBlockAuthorIndex = author_index;
7718
7735
  header.entropySource = entropy_source;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeberry/lib",
3
- "version": "0.0.1-f0ab5f1",
3
+ "version": "0.0.2-5755578",
4
4
  "main": "index.js",
5
5
  "author": "Fluffy Labs",
6
6
  "license": "MPL-2.0"