@typeberry/jam 0.4.0-4809f38 → 0.4.0-fcdfbb1

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
@@ -31185,7 +31185,7 @@ function jip_chain_spec_parseBootnode(v) {
31185
31185
  if (name === "" || ip === "" || port === "") {
31186
31186
  throw new Error(`Invalid bootnode format, expected: <name>@<ip>:<port>, got: "${v}"`);
31187
31187
  }
31188
- const portNumber = Number.parseInt(port);
31188
+ const portNumber = Number.parseInt(port, 10);
31189
31189
  if (!isU16(portNumber)) {
31190
31190
  throw new Error(`Invalid port number: "${port}"`);
31191
31191
  }
@@ -37588,11 +37588,9 @@ class JamConfig {
37588
37588
 
37589
37589
  /** Helper function to create most used hashes in the block */
37590
37590
  class hasher_TransitionHasher {
37591
- context;
37592
37591
  keccakHasher;
37593
37592
  blake2b;
37594
- constructor(context, keccakHasher, blake2b) {
37595
- this.context = context;
37593
+ constructor(keccakHasher, blake2b) {
37596
37594
  this.keccakHasher = keccakHasher;
37597
37595
  this.blake2b = blake2b;
37598
37596
  }
@@ -45578,13 +45576,11 @@ class AccumulateDataItem {
45578
45576
  * - gas cost and reports length for each service (statistics)
45579
45577
  */
45580
45578
  class AccumulateData {
45581
- autoAccumulateServicesByServiceId;
45582
45579
  reportsDataByServiceId;
45583
45580
  transfersByServiceId;
45584
45581
  serviceIds;
45585
45582
  gasLimitByServiceId;
45586
45583
  constructor(reports, transfers, autoAccumulateServicesByServiceId) {
45587
- this.autoAccumulateServicesByServiceId = autoAccumulateServicesByServiceId;
45588
45584
  const serviceIdsFromAutoAccumulate = new Set(autoAccumulateServicesByServiceId.keys());
45589
45585
  const { reportsDataByServiceId, serviceIds: serviceIdsFromReports, gasLimitByServiceId: reportsGasLimitByServiceId, } = this.transformReports(reports);
45590
45586
  this.reportsDataByServiceId = reportsDataByServiceId;
@@ -49764,7 +49760,7 @@ async function createImporter(config) {
49764
49760
  const interpreter = config.workerParams.pvm;
49765
49761
  const blocks = db.getBlocksDb();
49766
49762
  const states = db.getStatesDb();
49767
- const hasher = new hasher_TransitionHasher(chainSpec, await keccakHasher, await blake2b);
49763
+ const hasher = new hasher_TransitionHasher(await keccakHasher, await blake2b);
49768
49764
  const importer = new Importer(chainSpec, interpreter, hasher, main_logger, blocks, states);
49769
49765
  return {
49770
49766
  importer,
@@ -52488,7 +52484,7 @@ class generator_Generator {
52488
52484
  // select validator for block
52489
52485
  const validatorId = tryAsValidatorIndex(newTimeSlot % 6);
52490
52486
  // retriev data from previous block
52491
- const hasher = new TransitionHasher(this.chainSpec, this.keccakHasher, this.blake2b);
52487
+ const hasher = new TransitionHasher(this.keccakHasher, this.blake2b);
52492
52488
  const parentHeaderHash = this.lastHeaderHash;
52493
52489
  const stateRoot = this.states.getStateRoot(this.lastState);
52494
52490
  // create extrinsic