@leofcoin/chain 1.4.81 → 1.4.83

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.
@@ -2215,7 +2215,7 @@ class State extends Contract {
2215
2215
  this.#totalTransactions += 1;
2216
2216
  }
2217
2217
  catch (error) {
2218
- await globalThis.transactionPoolStore.delete(transaction.hash);
2218
+ await globalThis.transactionPoolStore.delete(transaction.hash ? transaction.hash : await (new TransactionMessage(transaction)).hash());
2219
2219
  console.log('removing invalid transaction');
2220
2220
  console.log(error);
2221
2221
  return false;
@@ -2270,7 +2270,7 @@ class State extends Contract {
2270
2270
  }
2271
2271
 
2272
2272
  globalThis.BigNumber = BigNumber;
2273
- const ignorelist = ['BA5XUACBBBAT653LT3GHP2Z5SUHVCA42BP6IBFBJACHOZIHHR4DUPG2XMB'];
2273
+ const ignorelist = ['BA5XUACBBBAT653LT3GHP2Z5SUHVCA42BP6IBFBJACHOZIHHR4DUPG2XMB', 'BA5XUACK6K5XA5P4BHRZ4SZT6FCLO6GLGCLUAD62WBPVLFK73RHZZUFLEG'];
2274
2274
  // check if browser or local
2275
2275
  class Chain extends State {
2276
2276
  #state;
@@ -2428,7 +2428,7 @@ class Chain extends State {
2428
2428
  console.log({ transactionsInPool });
2429
2429
  const transactionsToGet = [];
2430
2430
  for (const key of transactionsInPool) {
2431
- if (!transactions.includes(key))
2431
+ if (!transactions.includes(key) && !ignorelist.includes(key))
2432
2432
  transactionsToGet.push(transactionPoolStore.put(key, (await peernet.get(key, 'transaction'))));
2433
2433
  }
2434
2434
  console.log(await transactionPoolStore.keys());
@@ -6136,7 +6136,15 @@ const execute = async (contract, method, params) => {
6136
6136
  // state.put(result)
6137
6137
  return result
6138
6138
  } catch (e) {
6139
- throw e
6139
+ throw new Error(
6140
+ `
6141
+ error: ${e}
6142
+
6143
+ contract: ${contract}
6144
+ method: ${method}
6145
+ params: ${JSON.stringify(params, null, '\t')}
6146
+ `
6147
+ )
6140
6148
  }
6141
6149
  };
6142
6150
 
package/exports/chain.js CHANGED
@@ -841,7 +841,7 @@ class State extends Contract {
841
841
  this.#totalTransactions += 1;
842
842
  }
843
843
  catch (error) {
844
- await globalThis.transactionPoolStore.delete(transaction.hash);
844
+ await globalThis.transactionPoolStore.delete(transaction.hash ? transaction.hash : await (new TransactionMessage(transaction)).hash());
845
845
  console.log('removing invalid transaction');
846
846
  console.log(error);
847
847
  return false;
@@ -896,7 +896,7 @@ class State extends Contract {
896
896
  }
897
897
 
898
898
  globalThis.BigNumber = BigNumber;
899
- const ignorelist = ['BA5XUACBBBAT653LT3GHP2Z5SUHVCA42BP6IBFBJACHOZIHHR4DUPG2XMB'];
899
+ const ignorelist = ['BA5XUACBBBAT653LT3GHP2Z5SUHVCA42BP6IBFBJACHOZIHHR4DUPG2XMB', 'BA5XUACK6K5XA5P4BHRZ4SZT6FCLO6GLGCLUAD62WBPVLFK73RHZZUFLEG'];
900
900
  // check if browser or local
901
901
  class Chain extends State {
902
902
  #state;
@@ -1054,7 +1054,7 @@ class Chain extends State {
1054
1054
  console.log({ transactionsInPool });
1055
1055
  const transactionsToGet = [];
1056
1056
  for (const key of transactionsInPool) {
1057
- if (!transactions.includes(key))
1057
+ if (!transactions.includes(key) && !ignorelist.includes(key))
1058
1058
  transactionsToGet.push(transactionPoolStore.put(key, (await peernet.get(key, 'transaction'))));
1059
1059
  }
1060
1060
  console.log(await transactionPoolStore.keys());
@@ -1,5 +1,5 @@
1
1
  declare namespace _default {
2
- const datadir: string;
3
- const configPath: string;
2
+ let datadir: string;
3
+ let configPath: string;
4
4
  }
5
5
  export default _default;
@@ -1,6 +1,6 @@
1
1
  declare namespace _default {
2
2
  namespace block {
3
- const size: number;
3
+ let size: number;
4
4
  }
5
5
  }
6
6
  export default _default;
@@ -10,7 +10,7 @@ export default class Contract extends Transaction {
10
10
  * @param {Array} constructorParameters
11
11
  * @returns lib.createContractMessage
12
12
  */
13
- createContractMessage(creator: Address, contract: string, constructorParameters?: any[]): Promise<import("@leofcoin/messages").ContractMessage>;
13
+ createContractMessage(creator: Address, contract: string, constructorParameters?: any[]): Promise<any>;
14
14
  /**
15
15
  *
16
16
  * @param {Address} creator
@@ -1,4 +1,4 @@
1
1
  declare namespace _default {
2
- const deployment: number;
2
+ let deployment: number;
3
3
  }
4
4
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.81",
3
+ "version": "1.4.83",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",