@typeberry/jam 0.1.2-3178190 → 0.1.2-753d258

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/README.md CHANGED
@@ -15,7 +15,6 @@ Gray Paper compliance can be controlled via `GP_VERSION` environment variable.
15
15
  - [x] 0.6.7
16
16
  - [x] 0.7.0
17
17
  - [ ] 0.7.1 (partial)
18
- - [ ] 0.7.2 (partial)
19
18
 
20
19
  JAM Prize requirements
21
20
 
@@ -3575,7 +3575,6 @@ var GpVersion;
3575
3575
  GpVersion["V0_6_7"] = "0.6.7";
3576
3576
  GpVersion["V0_7_0"] = "0.7.0";
3577
3577
  GpVersion["V0_7_1"] = "0.7.1-preview";
3578
- GpVersion["V0_7_2"] = "0.7.2-preview";
3579
3578
  })(GpVersion || (GpVersion = {}));
3580
3579
  var TestSuite;
3581
3580
  (function (TestSuite) {
@@ -3583,7 +3582,7 @@ var TestSuite;
3583
3582
  TestSuite["JAMDUNA"] = "jamduna";
3584
3583
  })(TestSuite || (TestSuite = {}));
3585
3584
  const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
3586
- const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
3585
+ const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
3587
3586
  const env = typeof process === "undefined" ? {} : process.env;
3588
3587
  const DEFAULT_VERSION = GpVersion.V0_7_0;
3589
3588
  let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
@@ -3592,26 +3591,20 @@ function parseCurrentVersion(env) {
3592
3591
  if (env === undefined) {
3593
3592
  return undefined;
3594
3593
  }
3595
- switch (env) {
3596
- case GpVersion.V0_6_7:
3597
- case GpVersion.V0_7_0:
3598
- case GpVersion.V0_7_1:
3599
- case GpVersion.V0_7_2:
3600
- return env;
3601
- default:
3602
- throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
3594
+ const version = env;
3595
+ if (!Object.values(GpVersion).includes(version)) {
3596
+ throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
3603
3597
  }
3598
+ return version;
3604
3599
  }
3605
3600
  function parseCurrentSuite(env) {
3606
3601
  if (env === undefined)
3607
3602
  return undefined;
3608
- switch (env) {
3609
- case TestSuite.W3F_DAVXY:
3610
- case TestSuite.JAMDUNA:
3611
- return env;
3612
- default:
3613
- throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
3603
+ const val = env;
3604
+ if (!Object.values(TestSuite).includes(val)) {
3605
+ throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
3614
3606
  }
3607
+ return val;
3615
3608
  }
3616
3609
  class Compatibility {
3617
3610
  static override(version) {
@@ -12987,8 +12980,8 @@ function print(level, levelAndName, strings, data) {
12987
12980
  return;
12988
12981
  }
12989
12982
  const lvlText = Level[level].padEnd(5);
12990
- const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
12991
- const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
12983
+ const val = strings.map((v, idx) => `${v}${data[idx]}`);
12984
+ const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
12992
12985
  if (level === Level.WARN) {
12993
12986
  console.warn(msg);
12994
12987
  }
@@ -15478,17 +15471,6 @@ class page_range_PageRange {
15478
15471
  }
15479
15472
  return new page_range_PageRange(start, length);
15480
15473
  }
15481
- /** Returns true if the page range is wrapped (`start` >= `end`) and is not empty */
15482
- isWrapped() {
15483
- return this.start >= this.end && !this.isEmpty();
15484
- }
15485
- /** Checks if given page number is within the range */
15486
- isInRange(page) {
15487
- if (this.isWrapped()) {
15488
- return page >= this.start || page < this.end;
15489
- }
15490
- return page >= this.start && page < this.end;
15491
- }
15492
15474
  /** Checks if a range is empty (`length === 0`) */
15493
15475
  isEmpty() {
15494
15476
  return this.length === 0;
@@ -15868,11 +15850,10 @@ class memory_builder_MemoryBuilder {
15868
15850
  startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
15869
15851
  `;
15870
15852
  this.ensureNotFinalized();
15871
- const heapRange = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
15872
- const heapPagesRange = PageRange.fromMemoryRange(heapRange);
15873
- const initializedPageNumbers = Array.from(this.initialMemory.keys());
15874
- for (const pageNumber of initializedPageNumbers) {
15875
- if (heapPagesRange.isInRange(pageNumber)) {
15853
+ const range = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
15854
+ const pages = PageRange.fromMemoryRange(range);
15855
+ for (const pageNumber of pages) {
15856
+ if (this.initialMemory.has(pageNumber)) {
15876
15857
  throw new IncorrectSbrkIndex();
15877
15858
  }
15878
15859
  }