@partisiablockchain/blockchain-api-transaction-client 5.124.0 → 5.130.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partisiablockchain/blockchain-api-transaction-client",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.130.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"bn.js": "^5.2.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@stryker-mutator/core": "^
|
|
16
|
-
"@stryker-mutator/jest-runner": "^
|
|
17
|
-
"@stryker-mutator/typescript-checker": "^
|
|
15
|
+
"@stryker-mutator/core": "^9.0.0",
|
|
16
|
+
"@stryker-mutator/jest-runner": "^9.0.0",
|
|
17
|
+
"@stryker-mutator/typescript-checker": "^9.0.0",
|
|
18
18
|
"@eslint/eslintrc": "^3.0.2",
|
|
19
19
|
"@types/jest": "^29.5.5",
|
|
20
20
|
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExecutedTransaction } from "../generated/openapi";
|
|
1
|
+
import { ExecutedTransaction, Failure } from "../generated/openapi";
|
|
2
2
|
/** Status for a transaction and the whole tree of spawned events. */
|
|
3
3
|
export declare class TransactionTree {
|
|
4
4
|
/** The original transaction. */
|
|
@@ -17,4 +17,10 @@ export declare class TransactionTree {
|
|
|
17
17
|
* @returns true if the transaction tree includes any failures, false if all succeeded.
|
|
18
18
|
*/
|
|
19
19
|
hasFailures(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the failure, containing the error message and stack trace, of the first transaction or
|
|
22
|
+
* event which failed.
|
|
23
|
+
* @returns the first failure or undefined if nothing failed
|
|
24
|
+
*/
|
|
25
|
+
getFirstFailure(): Failure | undefined;
|
|
20
26
|
}
|
|
@@ -45,6 +45,26 @@ class TransactionTree {
|
|
|
45
45
|
}
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the failure, containing the error message and stack trace, of the first transaction or
|
|
50
|
+
* event which failed.
|
|
51
|
+
* @returns the first failure or undefined if nothing failed
|
|
52
|
+
*/
|
|
53
|
+
getFirstFailure() {
|
|
54
|
+
const allExecutedTransactions = [this.transaction, ...this.events];
|
|
55
|
+
for (const executedTransaction of allExecutedTransactions) {
|
|
56
|
+
if (!executedTransaction.executionStatus.success) {
|
|
57
|
+
const failure = executedTransaction.executionStatus.failure;
|
|
58
|
+
if (failure != undefined) {
|
|
59
|
+
return failure;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return { errorMessage: "Transaction failed without an error message", stackTrace: "" };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
48
68
|
}
|
|
49
69
|
exports.TransactionTree = TransactionTree;
|
|
50
70
|
//# sourceMappingURL=TransactionTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionTree.js","sourceRoot":"","sources":["../../../src/main/transactionclient/TransactionTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAIH,qEAAqE;AACrE,MAAa,eAAe;IAM1B;;;;OAIG;IACH,YAAY,WAAgC,EAAE,MAA6B;QACzE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,WAAW;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,eAAgB,CAAC,OAAO,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,OAAO,EAAE,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"TransactionTree.js","sourceRoot":"","sources":["../../../src/main/transactionclient/TransactionTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAIH,qEAAqE;AACrE,MAAa,eAAe;IAM1B;;;;OAIG;IACH,YAAY,WAAgC,EAAE,MAA6B;QACzE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,WAAW;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,eAAgB,CAAC,OAAO,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,OAAO,EAAE,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,eAAe;QACpB,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QACnE,KAAK,MAAM,mBAAmB,IAAI,uBAAuB,EAAE,CAAC;YAC1D,IAAI,CAAC,mBAAmB,CAAC,eAAgB,CAAC,OAAO,EAAE,CAAC;gBAClD,MAAM,OAAO,GAAG,mBAAmB,CAAC,eAAgB,CAAC,OAAO,CAAC;gBAC7D,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC;oBACzB,OAAO,OAAO,CAAC;gBACjB,CAAC;qBAAM,CAAC;oBACN,OAAO,EAAE,YAAY,EAAE,6CAA6C,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;gBACzF,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AApDD,0CAoDC"}
|