@ocap/tx-pipeline 1.22.2 → 1.23.0

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.
@@ -61,6 +61,16 @@ module.exports = function CreateVerifyTxInputPipe({
61
61
  message: `Token amount must be greater than 0 in each ${fieldKey} item`,
62
62
  fn: () => inputs.every((x) => getTokens(x).every(({ value }) => new BN(value).gt(ZERO))),
63
63
  },
64
+ {
65
+ error: 'INVALID_TX',
66
+ message: 'Inputs should not contain assets',
67
+ fn: () => !(assetsKey === null && assets.length > 0),
68
+ },
69
+ {
70
+ error: 'INVALID_TX',
71
+ message: 'Inputs should not contain tokens',
72
+ fn: () => !(tokensKey === null && tokens.length > 0),
73
+ },
64
74
  ];
65
75
 
66
76
  for (const { error, message, fn } of checks) {
@@ -71,8 +81,13 @@ module.exports = function CreateVerifyTxInputPipe({
71
81
 
72
82
  context[inputsKey] = inputs;
73
83
  context[sendersKey] = senders;
74
- context[tokensKey] = tokens;
75
- context[assetsKey] = assets;
84
+
85
+ if (tokensKey) {
86
+ context[tokensKey] = tokens;
87
+ }
88
+ if (assetsKey) {
89
+ context[assetsKey] = assets;
90
+ }
76
91
 
77
92
  next();
78
93
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.22.2",
6
+ "version": "1.23.0",
7
7
  "description": "Pipeline runner and common pipelines to process transactions",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -15,8 +15,8 @@
15
15
  "devDependencies": {
16
16
  "jest": "^29.7.0",
17
17
  "start-server-and-test": "^1.14.0",
18
- "@ocap/e2e-test": "1.22.2",
19
- "@ocap/statedb-memory": "1.22.2"
18
+ "@ocap/e2e-test": "1.23.0",
19
+ "@ocap/statedb-memory": "1.23.0"
20
20
  },
21
21
  "resolutions": {
22
22
  "bn.js": "5.2.1",
@@ -26,14 +26,14 @@
26
26
  "debug": "^4.3.6",
27
27
  "empty-value": "^1.0.1",
28
28
  "lodash": "^4.17.21",
29
- "@ocap/client": "1.22.2",
30
- "@ocap/mcrypto": "1.22.2",
31
- "@arcblock/did": "1.22.2",
32
- "@ocap/message": "1.22.2",
33
- "@ocap/state": "1.22.2",
34
- "@ocap/util": "1.22.2",
35
- "@ocap/wallet": "1.22.2",
36
- "@arcblock/did-util": "1.22.2"
29
+ "@arcblock/did": "1.23.0",
30
+ "@arcblock/did-util": "1.23.0",
31
+ "@ocap/client": "1.23.0",
32
+ "@ocap/mcrypto": "1.23.0",
33
+ "@ocap/message": "1.23.0",
34
+ "@ocap/state": "1.23.0",
35
+ "@ocap/util": "1.23.0",
36
+ "@ocap/wallet": "1.23.0"
37
37
  },
38
38
  "scripts": {
39
39
  "lint": "eslint tests lib",