@ocap/state 1.28.6 → 1.28.8

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
- const fs = require('fs');
1
+ const fs = require('node:fs');
2
2
  const { isSameDid } = require('@ocap/util');
3
3
  const { CustomError: Error } = require('@ocap/util/lib/error');
4
4
  const { BloomFilter } = require('bloom-filters');
@@ -18,7 +18,7 @@ class Blacklist {
18
18
  try {
19
19
  const json = JSON.parse(fs.readFileSync(dumpPath));
20
20
  filter = BloomFilter.fromJSON(json);
21
- } catch (err) {
21
+ } catch (_err) {
22
22
  throw new Error('INTERNAL', `Cat not read serialized blacklist from json${dumpPath}`);
23
23
  }
24
24
  }
@@ -94,7 +94,7 @@ class Blacklist {
94
94
  const tmpFile = `${this.dumpPath}~`;
95
95
  fs.writeFileSync(tmpFile, JSON.stringify(exported));
96
96
  fs.renameSync(tmpFile, this.dumpPath);
97
- } catch (err) {
97
+ } catch (_err) {
98
98
  // Do nothing
99
99
  }
100
100
  }
@@ -30,7 +30,6 @@ const update = (state, updates) => {
30
30
  );
31
31
  }
32
32
 
33
- // eslint-disable-next-line no-restricted-syntax
34
33
  for (const attr of immutableAttrs) {
35
34
  if (get(updates, attr) && !isEqual(get(updates, attr), get(state, attr))) {
36
35
  throw new Error('FORBIDDEN', `Cannot update ${attr} field on chain state`);
package/lib/states/tx.js CHANGED
@@ -92,7 +92,7 @@ const getTxSender = ({ tx, typeUrl }) => {
92
92
 
93
93
  const getReceiptChange = (receipts, { address, action }) => {
94
94
  const receipt = receipts.filter((x) => !address || x.address === address);
95
- const changes = receipt.map((x) => x.changes.filter((c) => !action || c.action === action)).flat();
95
+ const changes = receipt.flatMap((x) => x.changes.filter((c) => !action || c.action === action));
96
96
  return changes;
97
97
  };
98
98
 
package/lib/util.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-prototype-builtins */
2
- /* eslint-disable no-restricted-syntax */
3
1
  function nullify(obj) {
4
2
  if (typeof obj === 'undefined') {
5
3
  return null;
package/package.json CHANGED
@@ -3,38 +3,32 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.28.6",
6
+ "version": "1.28.8",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
10
10
  "lib"
11
11
  ],
12
+ "scripts": {
13
+ "lint": "biome check",
14
+ "lint:fix": "biome check --write",
15
+ "test": "bun test",
16
+ "coverage": "bun test --coverage"
17
+ },
12
18
  "dependencies": {
19
+ "@arcblock/did": "1.28.8",
20
+ "@arcblock/validator": "1.28.8",
21
+ "@ocap/contract": "1.28.8",
22
+ "@ocap/mcrypto": "1.28.8",
23
+ "@ocap/message": "1.28.8",
24
+ "@ocap/util": "1.28.8",
25
+ "@ocap/wallet": "1.28.8",
13
26
  "bloom-filters": "^1.3.9",
14
- "lodash": "^4.17.21",
15
- "@arcblock/did": "1.28.6",
16
- "@arcblock/validator": "1.28.6",
17
- "@ocap/contract": "1.28.6",
18
- "@ocap/mcrypto": "1.28.6",
19
- "@ocap/message": "1.28.6",
20
- "@ocap/util": "1.28.6",
21
- "@ocap/wallet": "1.28.6"
22
- },
23
- "devDependencies": {
24
- "jest": "^29.7.0",
25
- "start-server-and-test": "^1.14.0",
26
- "@ocap/e2e-test": "1.28.6"
27
+ "lodash": "^4.17.21"
27
28
  },
29
+ "devDependencies": {},
28
30
  "keywords": [],
29
31
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
30
32
  "license": "MIT",
31
- "gitHead": "e5764f753181ed6a7c615cd4fc6682aacf0cb7cd",
32
- "scripts": {
33
- "lint": "eslint tests lib",
34
- "lint:fix": "eslint --fix tests lib",
35
- "start": "node tools/start-chain.js",
36
- "test": "jest --forceExit --detectOpenHandles",
37
- "test:ci": "jest --forceExit --detectOpenHandles --coverage",
38
- "coverage": "start-server-and-test start http://127.0.0.1:4001 test:ci"
39
- }
40
- }
33
+ "gitHead": "e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"
34
+ }
package/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright 2018-2025 ArcBlock
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.