@leofcoin/chain 1.7.131 → 1.7.133

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.
@@ -4760,7 +4760,7 @@ class State extends Contract {
4760
4760
  };
4761
4761
  this.#knownBlocksHandler = async () => {
4762
4762
  return new globalThis.peernet.protos['peernet-response']({
4763
- response: { blocks: this.#blocks.map((block) => block.hash) }
4763
+ response: { blocks: await globalThis.blockStore.keys() }
4764
4764
  });
4765
4765
  };
4766
4766
  this.#loadBlockTransactions = (transactions) => Promise.all(transactions.map(async (transaction) => new TransactionMessage(await peernet.get(transaction))));
@@ -5316,7 +5316,7 @@ class State extends Contract {
5316
5316
  return this.syncChain(latest);
5317
5317
  }
5318
5318
  async triggerLoad() {
5319
- if (this.#blocks.length > 0) {
5319
+ if (this.#blocks?.length > 0) {
5320
5320
  this.#machine = await new Machine(this.#blocks);
5321
5321
  }
5322
5322
  }
package/exports/chain.js CHANGED
@@ -887,7 +887,7 @@ class State extends Contract {
887
887
  };
888
888
  this.#knownBlocksHandler = async () => {
889
889
  return new globalThis.peernet.protos['peernet-response']({
890
- response: { blocks: this.#blocks.map((block) => block.hash) }
890
+ response: { blocks: await globalThis.blockStore.keys() }
891
891
  });
892
892
  };
893
893
  this.#loadBlockTransactions = (transactions) => Promise.all(transactions.map(async (transaction) => new TransactionMessage(await peernet.get(transaction))));
@@ -1443,7 +1443,7 @@ class State extends Contract {
1443
1443
  return this.syncChain(latest);
1444
1444
  }
1445
1445
  async triggerLoad() {
1446
- if (this.#blocks.length > 0) {
1446
+ if (this.#blocks?.length > 0) {
1447
1447
  this.#machine = await new Machine(this.#blocks);
1448
1448
  }
1449
1449
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.131",
3
+ "version": "1.7.133",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {