@leofcoin/chain 1.7.154 → 1.7.156

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.
@@ -4189,7 +4189,7 @@ class Machine {
4189
4189
  break;
4190
4190
  }
4191
4191
  case 'debug': {
4192
- // debug(data.message)
4192
+ debug$2(data.message);
4193
4193
  if (data.message.includes('loaded transactions for block:')) {
4194
4194
  pubsub.publish('block-loaded', data.message.replace('loaded transactions for block: ', '').split(' @')[0]);
4195
4195
  }
@@ -4576,7 +4576,7 @@ class Machine {
4576
4576
  }
4577
4577
  async addLoadedBlock(block) {
4578
4578
  debug$2(`adding loaded block: ${block.index}@${block.hash}`);
4579
- debug$2(JSON.stringify(block, jsonStringifyBigInt));
4579
+ // debug(JSON.stringify(block, jsonStringifyBigInt))
4580
4580
  if (block.decoded)
4581
4581
  block = { ...block.decoded, hash: await block.hash() };
4582
4582
  return this.#askWorker('addLoadedBlock', JSON.stringify(block, jsonStringifyBigInt));
@@ -6157,7 +6157,7 @@ class Chain extends VersionControl {
6157
6157
  debug(`created block: ${hash} @${block.index}`);
6158
6158
  // Publish canonical encoded form via codec interface
6159
6159
  console.log(`[chain] 📤 Publishing block #${block.index} | hash: ${hash} | encoded bytes: ${blockMessage.encoded.length}`);
6160
- globalThis.peernet.publish('add-block', blockMessage.encoded);
6160
+ globalThis.peernet.publish('add-block', blockMessage.decoded);
6161
6161
  globalThis.pubsub.publish('add-block', blockMessage.decoded);
6162
6162
  }
6163
6163
  catch (error) {
package/exports/chain.js CHANGED
@@ -330,7 +330,7 @@ class Machine {
330
330
  break;
331
331
  }
332
332
  case 'debug': {
333
- // debug(data.message)
333
+ debug$2(data.message);
334
334
  if (data.message.includes('loaded transactions for block:')) {
335
335
  pubsub.publish('block-loaded', data.message.replace('loaded transactions for block: ', '').split(' @')[0]);
336
336
  }
@@ -717,7 +717,7 @@ class Machine {
717
717
  }
718
718
  async addLoadedBlock(block) {
719
719
  debug$2(`adding loaded block: ${block.index}@${block.hash}`);
720
- debug$2(JSON.stringify(block, jsonStringifyBigInt));
720
+ // debug(JSON.stringify(block, jsonStringifyBigInt))
721
721
  if (block.decoded)
722
722
  block = { ...block.decoded, hash: await block.hash() };
723
723
  return this.#askWorker('addLoadedBlock', JSON.stringify(block, jsonStringifyBigInt));
@@ -2298,7 +2298,7 @@ class Chain extends VersionControl {
2298
2298
  debug(`created block: ${hash} @${block.index}`);
2299
2299
  // Publish canonical encoded form via codec interface
2300
2300
  console.log(`[chain] 📤 Publishing block #${block.index} | hash: ${hash} | encoded bytes: ${blockMessage.encoded.length}`);
2301
- globalThis.peernet.publish('add-block', blockMessage.encoded);
2301
+ globalThis.peernet.publish('add-block', blockMessage.decoded);
2302
2302
  globalThis.pubsub.publish('add-block', blockMessage.decoded);
2303
2303
  }
2304
2304
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.154",
3
+ "version": "1.7.156",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {