@ocap/tx-protocols 1.14.0 → 1.14.4
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.
- package/lib/protocols/asset/create.js +1 -12
- package/package.json +18 -15
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
const Error = require('@ocap/util/lib/error');
|
|
3
3
|
const isEmpty = require('lodash/isEmpty');
|
|
4
4
|
const cloneDeep = require('lodash/cloneDeep');
|
|
5
|
-
const Joi = require('@ocap/validator');
|
|
6
5
|
const { Runner, pipes } = require('@ocap/tx-pipeline');
|
|
7
6
|
const { account, asset } = require('@ocap/state');
|
|
8
7
|
const { toAssetAddress } = require('@arcblock/did-util');
|
|
@@ -18,18 +17,8 @@ const runner = new Runner();
|
|
|
18
17
|
runner.use(pipes.VerifyMultiSig(0));
|
|
19
18
|
|
|
20
19
|
// Verify itx
|
|
21
|
-
const schema = Joi.object({
|
|
22
|
-
moniker: Joi.string().min(2).max(255).required(),
|
|
23
|
-
data: Joi.any().required(),
|
|
24
|
-
readonly: Joi.boolean().default(false),
|
|
25
|
-
transferrable: Joi.boolean().default(false),
|
|
26
|
-
ttl: Joi.number().min(0).default(0),
|
|
27
|
-
parent: Joi.DID().optional().allow(''),
|
|
28
|
-
address: Joi.DID().role('ROLE_ASSET').required(),
|
|
29
|
-
issuer: Joi.DID().optional().allow(''),
|
|
30
|
-
}).options({ stripUnknown: true, noDefaults: false });
|
|
31
20
|
runner.use(({ itx }, next) => {
|
|
32
|
-
const { error } = schema.validate(itx);
|
|
21
|
+
const { error } = asset.schema.validate(itx);
|
|
33
22
|
if (error) {
|
|
34
23
|
return next(new Error('INVALID_TX', `Invalid itx: ${error.message}`));
|
|
35
24
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.14.
|
|
6
|
+
"version": "1.14.4",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -12,24 +12,26 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"lint": "eslint tests lib",
|
|
14
14
|
"lint:fix": "eslint --fix tests lib",
|
|
15
|
+
"start": "node tools/start-chain.js",
|
|
15
16
|
"test": "jest --forceExit --detectOpenHandles",
|
|
16
|
-
"
|
|
17
|
+
"test:ci": "jest --forceExit --detectOpenHandles --coverage",
|
|
18
|
+
"coverage": "start-server-and-test start http://127.0.0.1:4001 test:ci"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [],
|
|
19
21
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
22
|
"license": "MIT",
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"@arcblock/did": "1.14.
|
|
23
|
-
"@arcblock/did-util": "1.14.
|
|
24
|
-
"@ocap/asset": "1.14.
|
|
25
|
-
"@ocap/mcrypto": "1.14.
|
|
26
|
-
"@ocap/merkle-tree": "1.14.
|
|
27
|
-
"@ocap/message": "1.14.
|
|
28
|
-
"@ocap/state": "1.14.
|
|
29
|
-
"@ocap/tx-pipeline": "1.14.
|
|
30
|
-
"@ocap/util": "1.14.
|
|
31
|
-
"@ocap/validator": "1.14.
|
|
32
|
-
"@ocap/wallet": "1.14.
|
|
24
|
+
"@arcblock/did": "1.14.4",
|
|
25
|
+
"@arcblock/did-util": "1.14.4",
|
|
26
|
+
"@ocap/asset": "1.14.4",
|
|
27
|
+
"@ocap/mcrypto": "1.14.4",
|
|
28
|
+
"@ocap/merkle-tree": "1.14.4",
|
|
29
|
+
"@ocap/message": "1.14.4",
|
|
30
|
+
"@ocap/state": "1.14.4",
|
|
31
|
+
"@ocap/tx-pipeline": "1.14.4",
|
|
32
|
+
"@ocap/util": "1.14.4",
|
|
33
|
+
"@ocap/validator": "1.14.4",
|
|
34
|
+
"@ocap/wallet": "1.14.4",
|
|
33
35
|
"debug": "^4.3.2",
|
|
34
36
|
"empty-value": "^1.0.1",
|
|
35
37
|
"lodash": "^4.17.21",
|
|
@@ -40,7 +42,8 @@
|
|
|
40
42
|
"elliptic": "6.5.3"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
|
-
"jest": "^27.3.1"
|
|
45
|
+
"jest": "^27.3.1",
|
|
46
|
+
"start-server-and-test": "^1.14.0"
|
|
44
47
|
},
|
|
45
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "33f7b1d72aa51e58a269b2681bd19e2119d1721e"
|
|
46
49
|
}
|