@leofcoin/chain 1.8.8 → 1.8.9

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,4 +1,4 @@
1
- import { t as toBase58, T as TransactionMessage, C as ContractMessage, R as RawTransactionMessage, B as BlockMessage, c as currentVersion, a as BWMessage, b as BWRequestMessage } from './flags-wmeqg14g.js';
1
+ import { t as toBase58, T as TransactionMessage, C as ContractMessage, R as RawTransactionMessage, B as BlockMessage, P as PROTOCOL_VERSION, a as REACHED_ONE_ZERO_ZERO, b as BWMessage, c as BWRequestMessage } from './constants-ByuwyBVy.js';
2
2
  import { log } from 'console';
3
3
  import { log as log$1 } from 'node:console';
4
4
 
@@ -1201,8 +1201,8 @@ function requireRe () {
1201
1201
 
1202
1202
  // ## Pre-release Version Identifier
1203
1203
  // A numeric identifier, or a non-numeric identifier.
1204
- // Non-numberic identifiers include numberic identifiers but can be longer.
1205
- // Therefore non-numberic identifiers must go first.
1204
+ // Non-numeric identifiers include numeric identifiers but can be longer.
1205
+ // Therefore non-numeric identifiers must go first.
1206
1206
 
1207
1207
  createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
1208
1208
  }|${src[t.NUMERICIDENTIFIER]})`);
@@ -1898,7 +1898,7 @@ function requireDiff () {
1898
1898
  return prefix + 'patch'
1899
1899
  }
1900
1900
 
1901
- // high and low are preleases
1901
+ // high and low are prereleases
1902
1902
  return 'prerelease'
1903
1903
  };
1904
1904
 
@@ -3457,7 +3457,7 @@ function requireSubset () {
3457
3457
  // - If LT
3458
3458
  // - If LT.semver is greater than any < or <= comp in C, return false
3459
3459
  // - If LT is <=, and LT.semver does not satisfy every C, return false
3460
- // - If GT.semver has a prerelease, and not in prerelease mode
3460
+ // - If LT.semver has a prerelease, and not in prerelease mode
3461
3461
  // - If no C has a prerelease and the LT.semver tuple, return false
3462
3462
  // - Else return true
3463
3463
 
@@ -5270,14 +5270,20 @@ class State extends Contract {
5270
5270
  }
5271
5271
  try {
5272
5272
  const block = await this.getAndPutBlock(hash);
5273
- await Promise.all(block.decoded.transactions.map(async (hash) => {
5273
+ await Promise.all(block.decoded.transactions
5274
+ .filter((hash) => Boolean(hash))
5275
+ .map(async (hash) => {
5274
5276
  // should be in a transaction store already
5275
- if (!(await transactionStore.has(hash))) {
5277
+ const exists = await transactionStore.has(hash);
5278
+ if (!exists) {
5276
5279
  const data = await peernet.get(hash, 'transaction');
5280
+ if (!data)
5281
+ throw new Error(`missing transaction data for ${hash}`);
5277
5282
  await transactionStore.put(hash, data);
5278
5283
  }
5279
- ;
5280
- (await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
5284
+ const inPool = await transactionPoolStore.has(hash);
5285
+ if (inPool)
5286
+ await transactionPoolStore.delete(hash);
5281
5287
  }));
5282
5288
  index = block.decoded.index;
5283
5289
  const size = block.encoded.length > 0 ? block.encoded.length : block.encoded.byteLength;
@@ -5697,8 +5703,8 @@ class VersionControl extends State {
5697
5703
  constructor(config) {
5698
5704
  super(config);
5699
5705
  }
5700
- #currentVersion = currentVersion;
5701
- #reachedOneZeroZero = false;
5706
+ #currentVersion = PROTOCOL_VERSION;
5707
+ #reachedOneZeroZero = REACHED_ONE_ZERO_ZERO;
5702
5708
  async #setCurrentVersion() {
5703
5709
  this.version = this.#currentVersion;
5704
5710
  await globalThis.chainStore.put('version', this.version);
@@ -5990,7 +5996,7 @@ class ConnectionMonitor {
5990
5996
  const networkName = globalThis.peernet?.network;
5991
5997
  if (networkName && typeof networkName === 'string') {
5992
5998
  // Try to import network config
5993
- const { default: networks } = await import('./networks-F1y7bMrB.js');
5999
+ const { default: networks } = await import('./constants-ByuwyBVy.js').then(function (n) { return n.n; });
5994
6000
  const [mainKey, subKey] = networkName.split(':');
5995
6001
  const networkConfig = networks?.[mainKey]?.[subKey];
5996
6002
  if (networkConfig?.stars && Array.isArray(networkConfig.stars)) {