@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/index.js CHANGED
@@ -28244,6 +28244,7 @@ var GpVersion;
28244
28244
  GpVersion["V0_6_7"] = "0.6.7";
28245
28245
  GpVersion["V0_7_0"] = "0.7.0";
28246
28246
  GpVersion["V0_7_1"] = "0.7.1-preview";
28247
+ GpVersion["V0_7_2"] = "0.7.2-preview";
28247
28248
  })(GpVersion || (GpVersion = {}));
28248
28249
  var TestSuite;
28249
28250
  (function (TestSuite) {
@@ -28251,7 +28252,7 @@ var TestSuite;
28251
28252
  TestSuite["JAMDUNA"] = "jamduna";
28252
28253
  })(TestSuite || (TestSuite = {}));
28253
28254
  const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
28254
- const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
28255
+ const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
28255
28256
  const env = typeof process === "undefined" ? {} : process.env;
28256
28257
  const DEFAULT_VERSION = GpVersion.V0_7_0;
28257
28258
  let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
@@ -28260,20 +28261,26 @@ function parseCurrentVersion(env) {
28260
28261
  if (env === undefined) {
28261
28262
  return undefined;
28262
28263
  }
28263
- const version = env;
28264
- if (!Object.values(GpVersion).includes(version)) {
28265
- throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
28264
+ switch (env) {
28265
+ case GpVersion.V0_6_7:
28266
+ case GpVersion.V0_7_0:
28267
+ case GpVersion.V0_7_1:
28268
+ case GpVersion.V0_7_2:
28269
+ return env;
28270
+ default:
28271
+ throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
28266
28272
  }
28267
- return version;
28268
28273
  }
28269
28274
  function parseCurrentSuite(env) {
28270
28275
  if (env === undefined)
28271
28276
  return undefined;
28272
- const val = env;
28273
- if (!Object.values(TestSuite).includes(val)) {
28274
- throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
28277
+ switch (env) {
28278
+ case TestSuite.W3F_DAVXY:
28279
+ case TestSuite.JAMDUNA:
28280
+ return env;
28281
+ default:
28282
+ throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
28275
28283
  }
28276
- return val;
28277
28284
  }
28278
28285
  class Compatibility {
28279
28286
  static override(version) {
@@ -35183,8 +35190,8 @@ function print(level, levelAndName, strings, data) {
35183
35190
  return;
35184
35191
  }
35185
35192
  const lvlText = Level[level].padEnd(5);
35186
- const val = strings.map((v, idx) => `${v}${data[idx]}`);
35187
- const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
35193
+ const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
35194
+ const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
35188
35195
  if (level === Level.WARN) {
35189
35196
  console.warn(msg);
35190
35197
  }
@@ -61422,8 +61429,8 @@ var FetchKind;
61422
61429
 
61423
61430
 
61424
61431
  const info_IN_OUT_REG = 7;
61425
- const OFFSET_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 9 : 11;
61426
- const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 10 : 12;
61432
+ const OFFSET_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) || Compatibility.isGreaterOrEqual(GpVersion.V0_7_2) ? 9 : 11;
61433
+ const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) || Compatibility.isGreaterOrEqual(GpVersion.V0_7_2) ? 10 : 12;
61427
61434
  /**
61428
61435
  * Return info about some account.
61429
61436
  *
@@ -61440,7 +61447,7 @@ const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 10 : 12;
61440
61447
  * a = last accumulation timeslot
61441
61448
  * p = parent service
61442
61449
  *
61443
- * https://graypaper.fluffylabs.dev/#/38c4e62/338302338302?v=0.7.0
61450
+ * https://graypaper.fluffylabs.dev/#/ab2cdbd/333b00333b00?v=0.7.2
61444
61451
  */
61445
61452
  class Info {
61446
61453
  currentServiceId;
@@ -61470,6 +61477,8 @@ class Info {
61470
61477
  const offset = minU64(regs.get(OFFSET_REG), valueLength);
61471
61478
  // l
61472
61479
  const length = minU64(regs.get(LEN_REG), numbers_tryAsU64(valueLength - offset));
61480
+ // NOTE: casting to `Number` is safe in both places, since we are always bounded
61481
+ // by the actual `encodedInfo.length`, which is equal `96`.
61473
61482
  const chunk = encodedInfo.raw.subarray(Number(offset), Number(offset + length));
61474
61483
  const writeResult = memory.storeFrom(outputStart, chunk);
61475
61484
  if (writeResult.isError) {
@@ -61489,7 +61498,7 @@ class Info {
61489
61498
  *
61490
61499
  * Used exclusively by `info` host call.
61491
61500
  *
61492
- * https://graypaper.fluffylabs.dev/#/7e6ff6a/337602337602?v=0.6.7
61501
+ * https://graypaper.fluffylabs.dev/#/ab2cdbd/33920033b500?v=0.7.2
61493
61502
  */
61494
61503
  const codecServiceAccountInfoWithThresholdBalance = descriptors_codec.object({
61495
61504
  codeHash: descriptors_codec.bytes(hash_HASH_SIZE),