@typeberry/jam 0.1.2-8c85275 → 0.1.2-953c012

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,6 +15,7 @@ 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)
18
19
 
19
20
  JAM Prize requirements
20
21
 
@@ -3575,6 +3575,7 @@ 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";
3578
3579
  })(GpVersion || (GpVersion = {}));
3579
3580
  var TestSuite;
3580
3581
  (function (TestSuite) {
@@ -3582,7 +3583,7 @@ var TestSuite;
3582
3583
  TestSuite["JAMDUNA"] = "jamduna";
3583
3584
  })(TestSuite || (TestSuite = {}));
3584
3585
  const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
3585
- const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
3586
+ const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
3586
3587
  const env = typeof process === "undefined" ? {} : process.env;
3587
3588
  const DEFAULT_VERSION = GpVersion.V0_7_0;
3588
3589
  let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
@@ -3591,20 +3592,26 @@ function parseCurrentVersion(env) {
3591
3592
  if (env === undefined) {
3592
3593
  return undefined;
3593
3594
  }
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}`);
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}`);
3597
3603
  }
3598
- return version;
3599
3604
  }
3600
3605
  function parseCurrentSuite(env) {
3601
3606
  if (env === undefined)
3602
3607
  return undefined;
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)}`);
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)}`);
3606
3614
  }
3607
- return val;
3608
3615
  }
3609
3616
  class Compatibility {
3610
3617
  static override(version) {
@@ -12980,8 +12987,8 @@ function print(level, levelAndName, strings, data) {
12980
12987
  return;
12981
12988
  }
12982
12989
  const lvlText = Level[level].padEnd(5);
12983
- const val = strings.map((v, idx) => `${v}${data[idx]}`);
12984
- const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
12990
+ const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
12991
+ const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
12985
12992
  if (level === Level.WARN) {
12986
12993
  console.warn(msg);
12987
12994
  }