@ocap/state 1.24.8 → 1.24.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.
@@ -41,6 +41,10 @@ const create = (attrs, context) => {
41
41
  ]),
42
42
  };
43
43
 
44
+ if (asset.tags === null) {
45
+ asset.tags = [];
46
+ }
47
+
44
48
  asset.address = toAddress(asset.address);
45
49
 
46
50
  return validate(asset);
@@ -53,6 +57,10 @@ const update = (state, attrs, context) => {
53
57
  context: updateStateContext(state.context, context),
54
58
  };
55
59
 
60
+ if (asset.tags === null) {
61
+ asset.tags = [];
62
+ }
63
+
56
64
  if (!asset.consumedTime) {
57
65
  asset.consumedTime = '';
58
66
  }
@@ -60,12 +60,19 @@ const create = (attrs, context) => {
60
60
  return validate(factory);
61
61
  };
62
62
 
63
- const update = (state, attrs, context) =>
64
- validate({
63
+ const update = (state, attrs, context) => {
64
+ const factory = {
65
65
  ...state,
66
66
  ...pick(attrs, ['numMinted', 'tokens']),
67
67
  context: updateStateContext(state.context, context),
68
- });
68
+ };
69
+
70
+ if (factory.output?.tags === null) {
71
+ factory.output.tags = [];
72
+ }
73
+
74
+ return validate(factory);
75
+ };
69
76
 
70
77
  const validate = (state) => {
71
78
  const { value, error } = stateSchema.validate(state);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.24.8",
6
+ "version": "1.24.9",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -12,18 +12,18 @@
12
12
  "dependencies": {
13
13
  "bloom-filters": "^1.3.9",
14
14
  "lodash": "^4.17.21",
15
- "@arcblock/did": "1.24.8",
16
- "@arcblock/validator": "1.24.8",
17
- "@ocap/contract": "1.24.8",
18
- "@ocap/mcrypto": "1.24.8",
19
- "@ocap/message": "1.24.8",
20
- "@ocap/util": "1.24.8",
21
- "@ocap/wallet": "1.24.8"
15
+ "@arcblock/validator": "1.24.9",
16
+ "@ocap/contract": "1.24.9",
17
+ "@ocap/mcrypto": "1.24.9",
18
+ "@arcblock/did": "1.24.9",
19
+ "@ocap/message": "1.24.9",
20
+ "@ocap/util": "1.24.9",
21
+ "@ocap/wallet": "1.24.9"
22
22
  },
23
23
  "devDependencies": {
24
24
  "jest": "^29.7.0",
25
25
  "start-server-and-test": "^1.14.0",
26
- "@ocap/e2e-test": "1.24.8"
26
+ "@ocap/e2e-test": "1.24.9"
27
27
  },
28
28
  "keywords": [],
29
29
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",