@ocap/tx-protocols 1.17.5 → 1.17.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,6 +1,7 @@
|
|
|
1
1
|
const get = require('lodash/get');
|
|
2
2
|
const cloneDeep = require('lodash/cloneDeep');
|
|
3
3
|
const { Joi } = require('@arcblock/validator');
|
|
4
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
|
4
5
|
const { getListField } = require('@ocap/util/lib/get-list-field');
|
|
5
6
|
const { Runner, pipes } = require('@ocap/tx-pipeline');
|
|
6
7
|
const { delegation, account } = require('@ocap/state');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const deepDiff = require('deep-diff');
|
|
1
|
+
const { diff: deepDiff } = require('deep-diff');
|
|
2
2
|
const { CustomError: Error } = require('@ocap/util/lib/error');
|
|
3
3
|
const { Joi } = require('@arcblock/validator');
|
|
4
4
|
const { Runner, pipes } = require('@ocap/tx-pipeline');
|
|
@@ -61,7 +61,7 @@ runner.use(async (context, next) => {
|
|
|
61
61
|
if (newData.type !== assetState.data.type) {
|
|
62
62
|
return next(new Error('FORBIDDEN', 'Asset data type can only be updated by owner'));
|
|
63
63
|
}
|
|
64
|
-
const dataDiff = deepDiff(assetState.data.value, newData.value);
|
|
64
|
+
const dataDiff = deepDiff(assetState.data.value, newData.value) || [];
|
|
65
65
|
const appendOnly = dataDiff.every((x) => x.kind === 'N' || (x.kind === 'A' && x.item.kind === 'N'));
|
|
66
66
|
if (appendOnly === false) {
|
|
67
67
|
return next(new Error('APPEND_ONLY', 'Asset data value can only be updated in append only mode'));
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.
|
|
6
|
+
"version": "1.17.8",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@arcblock/did": "1.17.
|
|
25
|
-
"@arcblock/did-util": "1.17.
|
|
26
|
-
"@arcblock/validator": "1.17.
|
|
27
|
-
"@ocap/asset": "1.17.
|
|
28
|
-
"@ocap/mcrypto": "1.17.
|
|
29
|
-
"@ocap/merkle-tree": "1.17.
|
|
30
|
-
"@ocap/message": "1.17.
|
|
31
|
-
"@ocap/state": "1.17.
|
|
32
|
-
"@ocap/tx-pipeline": "1.17.
|
|
33
|
-
"@ocap/util": "1.17.
|
|
34
|
-
"@ocap/wallet": "1.17.
|
|
35
|
-
"debug": "^4.3.
|
|
24
|
+
"@arcblock/did": "1.17.8",
|
|
25
|
+
"@arcblock/did-util": "1.17.8",
|
|
26
|
+
"@arcblock/validator": "1.17.8",
|
|
27
|
+
"@ocap/asset": "1.17.8",
|
|
28
|
+
"@ocap/mcrypto": "1.17.8",
|
|
29
|
+
"@ocap/merkle-tree": "1.17.8",
|
|
30
|
+
"@ocap/message": "1.17.8",
|
|
31
|
+
"@ocap/state": "1.17.8",
|
|
32
|
+
"@ocap/tx-pipeline": "1.17.8",
|
|
33
|
+
"@ocap/util": "1.17.8",
|
|
34
|
+
"@ocap/wallet": "1.17.8",
|
|
35
|
+
"debug": "^4.3.4",
|
|
36
36
|
"deep-diff": "^1.0.2",
|
|
37
37
|
"empty-value": "^1.0.1",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"elliptic": "6.5.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"jest": "^27.
|
|
46
|
+
"jest": "^27.5.1",
|
|
47
47
|
"start-server-and-test": "^1.14.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "04da221a224c17054eedf6317645e09e76258476"
|
|
50
50
|
}
|