@ocap/tx-pipeline 1.16.16 → 1.16.17
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/pipes/anti-land-attack.js +1 -1
- package/lib/pipes/decode-itx.js +1 -1
- package/lib/pipes/decode-tx.js +1 -1
- package/lib/pipes/extract-signer.js +2 -2
- package/lib/pipes/extract-state.js +4 -4
- package/lib/pipes/update-owner.js +1 -1
- package/lib/pipes/verify-account-migration.js +2 -2
- package/lib/pipes/verify-delegation.js +2 -2
- package/lib/pipes/verify-info.js +1 -1
- package/lib/pipes/verify-list-size.js +1 -1
- package/lib/pipes/verify-multisig-v2.js +2 -2
- package/lib/pipes/verify-multisig.js +2 -2
- package/lib/pipes/verify-sender.js +1 -1
- package/lib/pipes/verify-service-fee.js +1 -1
- package/lib/pipes/verify-signature.js +1 -1
- package/lib/pipes/verify-signer.js +2 -2
- package/lib/pipes/verify-token-balance.js +2 -2
- package/lib/pipes/verify-transferrable.js +1 -1
- package/lib/pipes/verify-tx-input.js +3 -3
- package/lib/pipes/verify-tx-size.js +1 -1
- package/lib/pipes/verify-tx.js +2 -2
- package/lib/pipes/verify-updater.js +2 -2
- package/package.json +9 -9
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function CreateAntiLandAttackPipe({
|
6
6
|
senderState = 'senderState',
|
package/lib/pipes/decode-itx.js
CHANGED
package/lib/pipes/decode-tx.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
const Mcrypto = require('@ocap/mcrypto');
|
2
2
|
const { getMessageType } = require('@ocap/message');
|
3
3
|
const { fromBase64, toUint8Array } = require('@ocap/util');
|
4
|
-
const Error = require('@ocap/util/lib/error');
|
4
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
5
5
|
|
6
6
|
// eslint-disable-next-line global-require
|
7
7
|
const debug = require('debug')(`${require('../../package.json').name}:pipe:decode-tx`);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const set = require('lodash/set');
|
2
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
2
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function CreateExtractSignerPipe({
|
6
6
|
signerKey = 'signerStates',
|
@@ -2,11 +2,11 @@
|
|
2
2
|
const get = require('lodash/get');
|
3
3
|
const set = require('lodash/set');
|
4
4
|
const isEmpty = require('empty-value');
|
5
|
-
const Error = require('@ocap/util/lib/error');
|
6
|
-
const getRelatedAddresses = require('@ocap/util/lib/get-related-addr');
|
5
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
6
|
+
const { getRelatedAddresses } = require('@ocap/util/lib/get-related-addr');
|
7
7
|
const { types } = require('@ocap/mcrypto');
|
8
8
|
const { tables } = require('@ocap/state');
|
9
|
-
const { toTypeInfo } = require('@arcblock/did');
|
9
|
+
const { toTypeInfo, toTypeInfoStr } = require('@arcblock/did');
|
10
10
|
|
11
11
|
// eslint-disable-next-line global-require
|
12
12
|
const debug = require('debug')(`${require('../../package.json').name}:pipe:extract-state`);
|
@@ -77,7 +77,7 @@ module.exports = function CreateExtractStatePipe({ from, to, table, status = 'OK
|
|
77
77
|
const missing = list.find((x) => !result.find((r) => getRelatedAddrList(r).includes(x)));
|
78
78
|
debug('extract', { address, result, missing });
|
79
79
|
if (missing) {
|
80
|
-
const type =
|
80
|
+
const type = toTypeInfoStr(missing);
|
81
81
|
const role = (type.role || '').replace('ROLE_', '');
|
82
82
|
return next(new Error(status, `Invalid state extracted for ${role || table}: ${missing}`, { persist: true }));
|
83
83
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const get = require('lodash/get');
|
2
2
|
const set = require('lodash/set');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
// eslint-disable-next-line global-require
|
6
6
|
const debug = require('debug')(`${require('../../package.json').name}:pipe:update-owner`);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
4
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
4
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
5
5
|
|
6
6
|
// 因为 statedb 层读取数据时会自动获取迁移之后的账户,所以这里可以直接对比 state,而不用检查 migratedTo
|
7
7
|
module.exports = function CreateVerifyAccountMigrationPipe({ signerKey = 'signerStates', senderKey = 'senderState' }) {
|
@@ -3,8 +3,8 @@
|
|
3
3
|
const get = require('lodash/get');
|
4
4
|
const set = require('lodash/set');
|
5
5
|
const isEmpty = require('empty-value');
|
6
|
-
const Error = require('@ocap/util/lib/error');
|
7
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
6
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
7
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
8
8
|
const { toDelegateAddress } = require('@arcblock/did-util');
|
9
9
|
|
10
10
|
// eslint-disable-next-line global-require
|
package/lib/pipes/verify-info.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function CreateVerifyListSizePipe({ listKey }) {
|
6
6
|
return function VerifyListSize(context, next) {
|
@@ -2,8 +2,8 @@
|
|
2
2
|
const get = require('lodash/get');
|
3
3
|
const omit = require('lodash/omit');
|
4
4
|
const cloneDeep = require('lodash/cloneDeep');
|
5
|
-
const Error = require('@ocap/util/lib/error');
|
6
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
5
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
6
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
7
7
|
const { toTypeInfo } = require('@arcblock/did');
|
8
8
|
const { fromPublicKey } = require('@ocap/wallet');
|
9
9
|
const { createMessage, decodeAny } = require('@ocap/message');
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const cloneDeep = require('lodash/cloneDeep');
|
2
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
2
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
3
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
4
4
|
const { toTypeInfo } = require('@arcblock/did');
|
5
5
|
const { fromPublicKey } = require('@ocap/wallet');
|
6
6
|
const { createMessage, decodeAny } = require('@ocap/message');
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function CreateVerifySenderPipe({ state = 'senderState' } = {}) {
|
6
6
|
return function VerifySender(context, next) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const get = require('lodash/get');
|
2
2
|
const cloneDeep = require('lodash/cloneDeep');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
const { toTypeInfo, isFromPublicKey } = require('@arcblock/did');
|
5
5
|
const { fromPublicKey } = require('@ocap/wallet');
|
6
6
|
const { createMessage } = require('@ocap/message');
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
4
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
5
5
|
|
6
6
|
// eslint-disable-next-line global-require
|
7
7
|
const debug = require('debug')(`${require('../../package.json').name}:pipe:verify-signer`);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
3
|
const isEmpty = require('empty-value');
|
4
|
-
const Error = require('@ocap/util/lib/error');
|
5
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
4
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
5
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
6
6
|
const { BN } = require('@ocap/util');
|
7
7
|
|
8
8
|
module.exports = function CreateVerifyTokenBalancePipe({ ownerKey, conditionKey, tokensKey = 'tokens' }) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function CreateVerifyTransferrablePipe({ assets }) {
|
6
6
|
return function VerifyTransferrable(context, next) {
|
@@ -2,9 +2,9 @@
|
|
2
2
|
const get = require('lodash/get');
|
3
3
|
const isEmpty = require('empty-value');
|
4
4
|
const { BN } = require('@ocap/util');
|
5
|
-
const Error = require('@ocap/util/lib/error');
|
6
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
7
|
-
const createSortedList = require('@ocap/util/lib/create-sorted-list');
|
5
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
6
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
7
|
+
const { createSortedList } = require('@ocap/util/lib/create-sorted-list');
|
8
8
|
|
9
9
|
const ZERO = new BN(0);
|
10
10
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
4
|
|
5
5
|
module.exports = function VerifyTxSize(context, next) {
|
6
6
|
const { txSize, txType, tx, config } = context;
|
package/lib/pipes/verify-tx.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
3
|
const isEmpty = require('empty-value');
|
4
|
-
const Error = require('@ocap/util/lib/error');
|
5
|
-
const getListField = require('@ocap/util/lib/get-list-field');
|
4
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
5
|
+
const { getListField } = require('@ocap/util/lib/get-list-field');
|
6
6
|
const { isFromPublicKey } = require('@arcblock/did');
|
7
7
|
|
8
8
|
module.exports = function VerifyTx(context, next) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
2
|
const get = require('lodash/get');
|
3
|
-
const Error = require('@ocap/util/lib/error');
|
4
|
-
const getRelatedAddresses = require('@ocap/util/lib/get-related-addr');
|
3
|
+
const { CustomError: Error } = require('@ocap/util/lib/error');
|
4
|
+
const { getRelatedAddresses } = require('@ocap/util/lib/get-related-addr');
|
5
5
|
|
6
6
|
// eslint-disable-next-line global-require
|
7
7
|
const debug = require('debug')(`${require('../../package.json').name}:pipe:verify-owner`);
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"publishConfig": {
|
4
4
|
"access": "public"
|
5
5
|
},
|
6
|
-
"version": "1.16.
|
6
|
+
"version": "1.16.17",
|
7
7
|
"description": "Pipeline runner and common pipelines to process transactions",
|
8
8
|
"main": "lib/index.js",
|
9
9
|
"files": [
|
@@ -29,16 +29,16 @@
|
|
29
29
|
"elliptic": "6.5.3"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@arcblock/did": "1.16.
|
33
|
-
"@arcblock/did-util": "1.16.
|
34
|
-
"@ocap/mcrypto": "1.16.
|
35
|
-
"@ocap/message": "1.16.
|
36
|
-
"@ocap/state": "1.16.
|
37
|
-
"@ocap/util": "1.16.
|
38
|
-
"@ocap/wallet": "1.16.
|
32
|
+
"@arcblock/did": "1.16.17",
|
33
|
+
"@arcblock/did-util": "1.16.17",
|
34
|
+
"@ocap/mcrypto": "1.16.17",
|
35
|
+
"@ocap/message": "1.16.17",
|
36
|
+
"@ocap/state": "1.16.17",
|
37
|
+
"@ocap/util": "1.16.17",
|
38
|
+
"@ocap/wallet": "1.16.17",
|
39
39
|
"debug": "^4.3.3",
|
40
40
|
"empty-value": "^1.0.1",
|
41
41
|
"lodash": "^4.17.21"
|
42
42
|
},
|
43
|
-
"gitHead": "
|
43
|
+
"gitHead": "489ce5e03bce27ddcd535390228b11ab56e7a2e3"
|
44
44
|
}
|