@leofcoin/chain 1.4.48 → 1.4.50

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.
@@ -8066,7 +8066,14 @@ class Chain extends Contract {
8066
8066
  async #init() {
8067
8067
  try {
8068
8068
  const version = await globalThis.chainStore.get('version');
8069
- this.version = version;
8069
+ this.version = new TextDecoder().decode(version);
8070
+ if (version !== '1.0.0') {
8071
+ this.version = '1.0.0';
8072
+ await globalThis.chainStore.clear();
8073
+ await globalThis.blockStore.clear();
8074
+ await globalThis.transactionPoolStore.clear();
8075
+ await globalThis.chainStore.put('version', this.version);
8076
+ }
8070
8077
  // if (version)
8071
8078
  }
8072
8079
  catch {
package/exports/chain.js CHANGED
@@ -661,7 +661,14 @@ class Chain extends Contract {
661
661
  async #init() {
662
662
  try {
663
663
  const version = await globalThis.chainStore.get('version');
664
- this.version = version;
664
+ this.version = new TextDecoder().decode(version);
665
+ if (version !== '1.0.0') {
666
+ this.version = '1.0.0';
667
+ await globalThis.chainStore.clear();
668
+ await globalThis.blockStore.clear();
669
+ await globalThis.transactionPoolStore.clear();
670
+ await globalThis.chainStore.put('version', this.version);
671
+ }
665
672
  // if (version)
666
673
  }
667
674
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.48",
3
+ "version": "1.4.50",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",