@ocap/tx-protocols 1.14.4 → 1.14.5
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/execute.js +2 -2
- package/lib/protocols/account/declare.js +9 -5
- package/package.json +13 -13
package/lib/execute.js
CHANGED
|
@@ -62,7 +62,7 @@ module.exports = ({ filter, runAsLambda }) => {
|
|
|
62
62
|
// we should only flush events when retry is not supported
|
|
63
63
|
// otherwise the outer caller should handle these 2
|
|
64
64
|
if (shouldPersistTx(err) && isRetrySupported === false) {
|
|
65
|
-
const txState = context.states.tx.create(context, err ? err.code : 'OK');
|
|
65
|
+
const txState = context.states.tx.create(context, err ? err.code || 'INTERNAL' : 'OK');
|
|
66
66
|
try {
|
|
67
67
|
await context.statedb.tx.create(txState.hash, txState, context);
|
|
68
68
|
} catch (e) {
|
|
@@ -100,7 +100,7 @@ module.exports = ({ filter, runAsLambda }) => {
|
|
|
100
100
|
} finally {
|
|
101
101
|
if (shouldPersistTx(error)) {
|
|
102
102
|
try {
|
|
103
|
-
const txState = context.states.tx.create(ctx, error ? error.code : 'OK');
|
|
103
|
+
const txState = context.states.tx.create(ctx, error ? error.code || 'INTERNAL' : 'OK');
|
|
104
104
|
flushEvents(ctx, { txState });
|
|
105
105
|
await runAsLambda(async (txn) => {
|
|
106
106
|
const newCtx = { ...omit(ctx, ['txn']), txn };
|
|
@@ -38,11 +38,15 @@ runner.use(
|
|
|
38
38
|
const { tx, itx, statedb } = context;
|
|
39
39
|
const tokens = { [context.config.token.address]: '0' };
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const [senderState] = await Promise.all([
|
|
42
|
+
statedb.account.create(
|
|
43
|
+
tx.from,
|
|
44
|
+
account.create({ address: tx.from, pk: toBase58(tx.pk), nonce: tx.nonce, tokens, ...itx }, context),
|
|
45
|
+
context
|
|
46
|
+
),
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
context.senderState = senderState;
|
|
46
50
|
|
|
47
51
|
next();
|
|
48
52
|
},
|
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.5",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@arcblock/did": "1.14.
|
|
25
|
-
"@arcblock/did-util": "1.14.
|
|
26
|
-
"@ocap/asset": "1.14.
|
|
27
|
-
"@ocap/mcrypto": "1.14.
|
|
28
|
-
"@ocap/merkle-tree": "1.14.
|
|
29
|
-
"@ocap/message": "1.14.
|
|
30
|
-
"@ocap/state": "1.14.
|
|
31
|
-
"@ocap/tx-pipeline": "1.14.
|
|
32
|
-
"@ocap/util": "1.14.
|
|
33
|
-
"@ocap/validator": "1.14.
|
|
34
|
-
"@ocap/wallet": "1.14.
|
|
24
|
+
"@arcblock/did": "1.14.5",
|
|
25
|
+
"@arcblock/did-util": "1.14.5",
|
|
26
|
+
"@ocap/asset": "1.14.5",
|
|
27
|
+
"@ocap/mcrypto": "1.14.5",
|
|
28
|
+
"@ocap/merkle-tree": "1.14.5",
|
|
29
|
+
"@ocap/message": "1.14.5",
|
|
30
|
+
"@ocap/state": "1.14.5",
|
|
31
|
+
"@ocap/tx-pipeline": "1.14.5",
|
|
32
|
+
"@ocap/util": "1.14.5",
|
|
33
|
+
"@ocap/validator": "1.14.5",
|
|
34
|
+
"@ocap/wallet": "1.14.5",
|
|
35
35
|
"debug": "^4.3.2",
|
|
36
36
|
"empty-value": "^1.0.1",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"jest": "^27.3.1",
|
|
46
46
|
"start-server-and-test": "^1.14.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9a685c7182412efc208a5193c17b92ec299dccb2"
|
|
49
49
|
}
|