@morpho-org/evm-simulation 4.1.6-next.0 → 4.1.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/cjs/errors.js
CHANGED
|
@@ -18,7 +18,7 @@ class SimulationRevertedError extends SimulationPackageError {
|
|
|
18
18
|
details;
|
|
19
19
|
code = "SIMULATION_REVERTED";
|
|
20
20
|
constructor(reason, details) {
|
|
21
|
-
super(reason ?? "Transaction simulation reverted");
|
|
21
|
+
super(reason ?? "Transaction simulation reverted", details instanceof Error ? { cause: details } : undefined);
|
|
22
22
|
this.reason = reason;
|
|
23
23
|
this.details = details;
|
|
24
24
|
}
|
|
@@ -92,6 +92,9 @@ async function simulateV1(params) {
|
|
|
92
92
|
throw error;
|
|
93
93
|
if (error instanceof errors_js_1.ExternalServiceError)
|
|
94
94
|
throw error;
|
|
95
|
+
// A node-level "execution reverted" is a property of the bundle, not the backend.
|
|
96
|
+
if (error instanceof viem_1.ExecutionRevertedError)
|
|
97
|
+
throw new errors_js_1.SimulationRevertedError(error.shortMessage, error);
|
|
95
98
|
throw new errors_js_1.ExternalServiceError(`eth_simulateV1 error: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
96
99
|
}
|
|
97
100
|
}
|
package/lib/esm/errors.js
CHANGED
|
@@ -14,7 +14,7 @@ export class SimulationRevertedError extends SimulationPackageError {
|
|
|
14
14
|
details;
|
|
15
15
|
code = "SIMULATION_REVERTED";
|
|
16
16
|
constructor(reason, details) {
|
|
17
|
-
super(reason ?? "Transaction simulation reverted");
|
|
17
|
+
super(reason ?? "Transaction simulation reverted", details instanceof Error ? { cause: details } : undefined);
|
|
18
18
|
this.reason = reason;
|
|
19
19
|
this.details = details;
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPublicClient, getAddress, http, maxUint256, } from "viem";
|
|
1
|
+
import { createPublicClient, ExecutionRevertedError, getAddress, http, maxUint256, } from "viem";
|
|
2
2
|
import { ExternalServiceError, SimulationRevertedError, SimulationValidationError, } from "../../errors.js";
|
|
3
3
|
import { groupAssetChanges } from "../asset-changes.js";
|
|
4
4
|
import { parseTransfers } from "../parsing/index.js";
|
|
@@ -89,6 +89,9 @@ export async function simulateV1(params) {
|
|
|
89
89
|
throw error;
|
|
90
90
|
if (error instanceof ExternalServiceError)
|
|
91
91
|
throw error;
|
|
92
|
+
// A node-level "execution reverted" is a property of the bundle, not the backend.
|
|
93
|
+
if (error instanceof ExecutionRevertedError)
|
|
94
|
+
throw new SimulationRevertedError(error.shortMessage, error);
|
|
92
95
|
throw new ExternalServiceError(`eth_simulateV1 error: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
93
96
|
}
|
|
94
97
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/evm-simulation",
|
|
3
3
|
"description": "EVM simulation engine for Morpho transactions.",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.7",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"zod": "^4.4.3",
|
|
28
|
-
"@morpho-org/blue-sdk": "^6.
|
|
29
|
-
"@morpho-org/morpho-ts": "^2.
|
|
28
|
+
"@morpho-org/blue-sdk": "^6.8.0",
|
|
29
|
+
"@morpho-org/morpho-ts": "^2.12.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"viem": "^2.0.0"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@morpho-org/test": "^2.10.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"prepublish": "
|
|
42
|
-
"build": "tsc --noEmit &&
|
|
41
|
+
"prepublish": "pnpm build",
|
|
42
|
+
"build": "tsc --noEmit && pnpm build:cjs && pnpm build:esm",
|
|
43
43
|
"build:cjs": "tsc --build tsconfig.build.cjs.json && echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json",
|
|
44
44
|
"build:esm": "tsc --build tsconfig.build.esm.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
|
45
45
|
"test": "vitest --root ../.. --project evm-simulation",
|