@leofcoin/workers 1.5.44 → 1.6.0

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.
@@ -1,6 +1,7 @@
1
- import { F as FormatInterface, p as proto, a as proto$1, e as encodeFrames, d as decodeFrames, E as EasyWorker } from './worker-BDTWOCzS.js';
1
+ import { B as BinaryFormat, p as proto, a as proto$1 } from './proposal.proto-8zgMfutf.js';
2
+ import { e as encodeFrames, d as decodeFrames, B as BinaryWorker } from './binary-worker-BxQdEW3s.js';
2
3
 
3
- class ValidatorMessage extends FormatInterface {
4
+ class ValidatorMessage extends BinaryFormat {
4
5
  get messageName() {
5
6
  return 'ValidatorMessage';
6
7
  }
@@ -12,7 +13,7 @@ class ValidatorMessage extends FormatInterface {
12
13
  }
13
14
  }
14
15
 
15
- class BlockMessage extends FormatInterface {
16
+ class BlockMessage extends BinaryFormat {
16
17
  get messageName() {
17
18
  return 'BlockMessage';
18
19
  }
@@ -40,14 +41,13 @@ class BlockMessage extends FormatInterface {
40
41
  encoded = encoded || this.encoded;
41
42
  super.decode(encoded);
42
43
  // @ts-ignore
43
- // Preserve historical acceptance of padded length prefixes. Tightening
44
- // canonical protocol validation is a separate, versioned decision.
45
- this.decoded.validators = decodeFrames(this.decoded.validators, 0, { canonical: false }).map((validator) => new ValidatorMessage(validator).decoded);
44
+ // Binary-only protocol also requires canonical validator frame lengths.
45
+ this.decoded.validators = decodeFrames(this.decoded.validators).map((validator) => new ValidatorMessage(validator).decoded);
46
46
  return this.decoded;
47
47
  }
48
48
  }
49
49
 
50
- const worker = new EasyWorker();
50
+ const worker = new BinaryWorker();
51
51
  globalThis.BigNumber = BigNumber;
52
52
  globalThis.contracts = {};
53
53
  const run = async (blocks) => {