@leofcoin/chain 1.8.20 → 1.8.22

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.
@@ -5655,7 +5655,7 @@ class State extends Contract {
5655
5655
  debug$1('sync timed out');
5656
5656
  }, this.requestTimeout);
5657
5657
  console.log({ promises });
5658
- promises = await Promise.any(promises);
5658
+ promises = await Promise.allSettled(promises);
5659
5659
  console.log({ promises });
5660
5660
  promises = promises.filter(({ status }) => status === 'fulfilled');
5661
5661
  clearTimeout(timeout);
@@ -6367,7 +6367,10 @@ class Chain extends VersionControl {
6367
6367
  }
6368
6368
  let lastBlock;
6369
6369
  try {
6370
- lastBlock = new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')).encoded;
6370
+ console.log('requesting last block from peer...');
6371
+ console.log(await this.lastBlock);
6372
+ console.log(new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')));
6373
+ lastBlock = new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')).decoded;
6371
6374
  }
6372
6375
  catch (error) {
6373
6376
  const peerName = peer?.peerId || peer?.id || peer?.address || peerId || 'unknown';
package/exports/chain.js CHANGED
@@ -1796,7 +1796,7 @@ class State extends Contract {
1796
1796
  debug$1('sync timed out');
1797
1797
  }, this.requestTimeout);
1798
1798
  console.log({ promises });
1799
- promises = await Promise.any(promises);
1799
+ promises = await Promise.allSettled(promises);
1800
1800
  console.log({ promises });
1801
1801
  promises = promises.filter(({ status }) => status === 'fulfilled');
1802
1802
  clearTimeout(timeout);
@@ -2508,7 +2508,10 @@ class Chain extends VersionControl {
2508
2508
  }
2509
2509
  let lastBlock;
2510
2510
  try {
2511
- lastBlock = new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')).encoded;
2511
+ console.log('requesting last block from peer...');
2512
+ console.log(await this.lastBlock);
2513
+ console.log(new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')));
2514
+ lastBlock = new LastBlockMessage(await this.#makeRequest(peer, 'lastBlock')).decoded;
2512
2515
  }
2513
2516
  catch (error) {
2514
2517
  const peerName = peer?.peerId || peer?.id || peer?.address || peerId || 'unknown';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.8.20",
3
+ "version": "1.8.22",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {