@ocap/tx-protocols 1.20.5 → 1.20.7
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 +15 -9
- package/lib/protocols/asset/acquire-v3.js +2 -2
- package/package.json +16 -16
package/lib/execute.js
CHANGED
|
@@ -173,7 +173,7 @@ module.exports = ({ filter, runAsLambda }) => {
|
|
|
173
173
|
|
|
174
174
|
return state;
|
|
175
175
|
},
|
|
176
|
-
{ cleanWorkingSet: true, verifyHash: true }
|
|
176
|
+
{ cleanWorkingSet: true, verifyHash: true, context: ctx }
|
|
177
177
|
);
|
|
178
178
|
|
|
179
179
|
// update indexdb after statedb commit
|
|
@@ -192,18 +192,24 @@ module.exports = ({ filter, runAsLambda }) => {
|
|
|
192
192
|
ctx.logger?.error('Failed to execute transaction', { error, txHash: ctx.txHash, txState });
|
|
193
193
|
|
|
194
194
|
if (txState && shouldPersistTx(error)) {
|
|
195
|
+
// Avoid sync data in failed transactions to indexdb
|
|
196
|
+
ctx.events = [];
|
|
197
|
+
|
|
195
198
|
try {
|
|
196
|
-
txState = await runAsLambda(
|
|
197
|
-
|
|
199
|
+
txState = await runAsLambda(
|
|
200
|
+
async (txn) => {
|
|
201
|
+
ctx = Object.assign({}, ctx, { txn, cacheStates: null });
|
|
198
202
|
|
|
199
|
-
|
|
203
|
+
await ensureGasFeePaid(ctx);
|
|
200
204
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
// Recreate tx to pick up gas related fields
|
|
206
|
+
const state = context.states.tx.create(ctx, txStatus);
|
|
207
|
+
await ctx.statedb.tx.create(state.hash, state, ctx);
|
|
204
208
|
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
return state;
|
|
210
|
+
},
|
|
211
|
+
{ cleanWorkingSet: true, verifyHash: true, context: ctx }
|
|
212
|
+
);
|
|
207
213
|
|
|
208
214
|
// update indexdb after statedb commit
|
|
209
215
|
flushEvents(ctx, { txState });
|
|
@@ -260,7 +260,7 @@ runner.use(
|
|
|
260
260
|
),
|
|
261
261
|
|
|
262
262
|
// create receiver if not exist: asset owner
|
|
263
|
-
ownerState
|
|
263
|
+
ownerState || owner === tx.from
|
|
264
264
|
? Promise.resolve(ownerState)
|
|
265
265
|
: statedb.account.create(owner, account.create({ address: owner }, context), context),
|
|
266
266
|
|
|
@@ -294,7 +294,7 @@ runner.use(
|
|
|
294
294
|
await updateVaults();
|
|
295
295
|
|
|
296
296
|
context.senderState = newSenderState;
|
|
297
|
-
context.receiverState = newReceiverState;
|
|
297
|
+
context.receiverState = owner === tx.from ? newSenderState : newReceiverState;
|
|
298
298
|
context.signerStates = isAlsoSigner ? newSignerStates.concat(newSenderState) : newSignerStates;
|
|
299
299
|
context.assetState = assetState;
|
|
300
300
|
context.factoryState = newFactoryState;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.20.
|
|
6
|
+
"version": "1.20.7",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
"empty-value": "^1.0.1",
|
|
19
19
|
"lodash": "^4.17.21",
|
|
20
20
|
"url-join": "^4.0.1",
|
|
21
|
-
"@arcblock/did": "1.20.
|
|
22
|
-
"@arcblock/
|
|
23
|
-
"@arcblock/
|
|
24
|
-
"@arcblock/validator": "1.20.
|
|
25
|
-
"@ocap/asset": "1.20.
|
|
26
|
-
"@ocap/mcrypto": "1.20.
|
|
27
|
-
"@ocap/merkle-tree": "1.20.
|
|
28
|
-
"@ocap/message": "1.20.
|
|
29
|
-
"@ocap/state": "1.20.
|
|
30
|
-
"@ocap/
|
|
31
|
-
"@ocap/
|
|
32
|
-
"@ocap/client": "1.20.
|
|
33
|
-
"@ocap/statedb-memory": "1.20.
|
|
34
|
-
"@ocap/
|
|
21
|
+
"@arcblock/did": "1.20.7",
|
|
22
|
+
"@arcblock/did-util": "1.20.7",
|
|
23
|
+
"@arcblock/jwt": "1.20.7",
|
|
24
|
+
"@arcblock/validator": "1.20.7",
|
|
25
|
+
"@ocap/asset": "1.20.7",
|
|
26
|
+
"@ocap/mcrypto": "1.20.7",
|
|
27
|
+
"@ocap/merkle-tree": "1.20.7",
|
|
28
|
+
"@ocap/message": "1.20.7",
|
|
29
|
+
"@ocap/state": "1.20.7",
|
|
30
|
+
"@ocap/util": "1.20.7",
|
|
31
|
+
"@ocap/wallet": "1.20.7",
|
|
32
|
+
"@ocap/client": "1.20.7",
|
|
33
|
+
"@ocap/statedb-memory": "1.20.7",
|
|
34
|
+
"@ocap/tx-pipeline": "1.20.7"
|
|
35
35
|
},
|
|
36
36
|
"resolutions": {
|
|
37
37
|
"bn.js": "5.2.1",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"jest": "^29.7.0",
|
|
42
42
|
"start-server-and-test": "^1.14.0",
|
|
43
|
-
"@ocap/e2e-test": "1.20.
|
|
43
|
+
"@ocap/e2e-test": "1.20.7"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"lint": "eslint tests lib",
|