@ocap/tx-protocols 1.18.110 → 1.18.112

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.
@@ -48,11 +48,6 @@ runner.use(
48
48
  message: 'Can not slash stake without any output',
49
49
  fn: ({ assets, tokens }) => !(isEmpty(tokens) && isEmpty(assets)),
50
50
  },
51
- {
52
- error: 'INVALID_TX',
53
- message: 'Can only send slashed token/assets to specified vault',
54
- fn: ({ config, receivers }) => receivers.every((x) => x === config.vaults.slashedStake),
55
- },
56
51
  ])
57
52
  );
58
53
 
@@ -77,6 +72,12 @@ runner.use(
77
72
  senderState.address
78
73
  ),
79
74
  },
75
+ {
76
+ error: 'INVALID_TX',
77
+ message: 'Can only send slashed token/assets to specified vault or slasher',
78
+ fn: ({ config, receivers, slasherStates }) =>
79
+ receivers.every((x) => x === config.vaults.slashedStake || slasherStates.some((s) => s.address === x)),
80
+ },
80
81
  ])
81
82
  );
82
83
 
@@ -29,6 +29,7 @@ const schema = Joi.object({
29
29
  inputsList: schemas.multiInput.min(1).required(),
30
30
  message: Joi.string().trim().min(1).max(256).required(),
31
31
  revokeWaitingPeriod: Joi.number().integer().min(0).default(0),
32
+ data: Joi.any().optional(),
32
33
  }).options({ stripUnknown: true, noDefaults: false });
33
34
  runner.use(({ itx }, next) => {
34
35
  const { error } = schema.validate(itx);
@@ -186,8 +187,8 @@ runner.use(
186
187
 
187
188
  const signerUpdates = {};
188
189
  const stakeUpdates = stakeState
189
- ? { tokens: stakeState.tokens, assets: stakeState.assets }
190
- : { tokens: {}, assets: [] };
190
+ ? { tokens: stakeState.tokens, assets: stakeState.assets, data: itx.data }
191
+ : { tokens: {}, assets: [], data: itx.data };
191
192
 
192
193
  inputs.forEach((x) => {
193
194
  const { owner, tokensList, assetsList } = x;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.18.110",
6
+ "version": "1.18.112",
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.18.110",
25
- "@arcblock/did-util": "1.18.110",
26
- "@arcblock/jwt": "1.18.110",
27
- "@arcblock/validator": "1.18.110",
28
- "@ocap/asset": "1.18.110",
29
- "@ocap/mcrypto": "1.18.110",
30
- "@ocap/merkle-tree": "1.18.110",
31
- "@ocap/message": "1.18.110",
32
- "@ocap/state": "1.18.110",
33
- "@ocap/tx-pipeline": "1.18.110",
34
- "@ocap/util": "1.18.110",
35
- "@ocap/wallet": "1.18.110",
24
+ "@arcblock/did": "1.18.112",
25
+ "@arcblock/did-util": "1.18.112",
26
+ "@arcblock/jwt": "1.18.112",
27
+ "@arcblock/validator": "1.18.112",
28
+ "@ocap/asset": "1.18.112",
29
+ "@ocap/mcrypto": "1.18.112",
30
+ "@ocap/merkle-tree": "1.18.112",
31
+ "@ocap/message": "1.18.112",
32
+ "@ocap/state": "1.18.112",
33
+ "@ocap/tx-pipeline": "1.18.112",
34
+ "@ocap/util": "1.18.112",
35
+ "@ocap/wallet": "1.18.112",
36
36
  "debug": "^4.3.4",
37
37
  "deep-diff": "^1.0.2",
38
38
  "empty-value": "^1.0.1",
@@ -47,5 +47,5 @@
47
47
  "jest": "^27.5.1",
48
48
  "start-server-and-test": "^1.14.0"
49
49
  },
50
- "gitHead": "c9f46e6cb5444892e6a228043ee73cc7553a5178"
50
+ "gitHead": "8f613b195dbab74c4159c072f6e0942ba5a3d56f"
51
51
  }