@typeberry/convert 0.5.1-aff8b4f → 0.5.1-b2fd1d5

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 +34 -6
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -19802,11 +19802,8 @@ class interpreter_Interpreter {
19802
19802
  this.memory.reset();
19803
19803
  }
19804
19804
  }
19805
- printProgram() {
19806
- const p = assemblify(this.code, this.mask);
19807
- // biome-ignore lint/suspicious/noConsole: We do want to print that.
19808
- console.table(p);
19809
- return p;
19805
+ dumpProgram() {
19806
+ return assemblify(this.code, this.mask);
19810
19807
  }
19811
19808
  runProgram() {
19812
19809
  while (this.nextStep() === Status.OK) { }
@@ -20338,7 +20335,14 @@ const SUPPORTED_TYPES = [
20338
20335
  decode: StateTransition.Codec,
20339
20336
  json: () => StateTransition.fromJson,
20340
20337
  process: {
20341
- options: ["as-pre-state", "as-post-state", "as-fuzz-message", "as-block"],
20338
+ options: [
20339
+ "as-pre-state",
20340
+ "as-post-state",
20341
+ "as-fuzz-message",
20342
+ "as-block-fuzz-message",
20343
+ "as-state-fuzz-message",
20344
+ "as-block",
20345
+ ],
20342
20346
  run(spec, data, option, blake2b) {
20343
20347
  const test = data;
20344
20348
  if (option === "as-pre-state") {
@@ -20358,6 +20362,10 @@ const SUPPORTED_TYPES = [
20358
20362
  });
20359
20363
  }
20360
20364
  if (option === "as-fuzz-message") {
20365
+ // biome-ignore lint/suspicious/noConsole: deprecation warning
20366
+ console.warn("⚠️ Warning: 'as-fuzz-message' is deprecated and will be removed in version 0.6.0. Use 'as-block-fuzz-message' instead.");
20367
+ }
20368
+ if (option === "as-block-fuzz-message" || option === "as-fuzz-message") {
20361
20369
  const encoded = encoder_Encoder.encodeObject(Block.Codec, test.block, spec);
20362
20370
  const blockView = decoder_Decoder.decodeObject(Block.Codec.View, encoded, spec);
20363
20371
  const msg = {
@@ -20369,6 +20377,26 @@ const SUPPORTED_TYPES = [
20369
20377
  encode: types_messageCodec,
20370
20378
  });
20371
20379
  }
20380
+ if (option === "as-state-fuzz-message") {
20381
+ const init = Initialize.create({
20382
+ header: header_Header.empty(),
20383
+ keyvals: test.pre_state.keyvals,
20384
+ ancestry: [
20385
+ AncestryItem.create({
20386
+ headerHash: test.block.header.parentHeaderHash,
20387
+ slot: common_tryAsTimeSlot(Math.max(0, test.block.header.timeSlotIndex - 1)),
20388
+ }),
20389
+ ],
20390
+ });
20391
+ const msg = {
20392
+ type: types_MessageType.Initialize,
20393
+ value: init,
20394
+ };
20395
+ return looseType({
20396
+ value: msg,
20397
+ encode: types_messageCodec,
20398
+ });
20399
+ }
20372
20400
  throw new Error(`Invalid processing option: ${option}`);
20373
20401
  },
20374
20402
  },