@nomicfoundation/edr 0.12.0-next.0 → 0.12.0-next.1
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/index.d.ts +21 -0
- package/package.json +8 -8
- package/src/solidity_tests/test_results.rs +39 -0
package/index.d.ts
CHANGED
|
@@ -841,6 +841,20 @@ export enum IncludeTraces {
|
|
|
841
841
|
}
|
|
842
842
|
export declare function l1SolidityTestRunnerFactory(): SolidityTestRunnerFactory
|
|
843
843
|
export declare function opSolidityTestRunnerFactory(): SolidityTestRunnerFactory
|
|
844
|
+
/** A grouping of value snapshot entries for a test. */
|
|
845
|
+
export interface ValueSnapshotGroup {
|
|
846
|
+
/** The group name. */
|
|
847
|
+
name: string
|
|
848
|
+
/** The entries in the group. */
|
|
849
|
+
entries: Array<ValueSnapshotEntry>
|
|
850
|
+
}
|
|
851
|
+
/** An entry in a value snapshot group. */
|
|
852
|
+
export interface ValueSnapshotEntry {
|
|
853
|
+
/** The name of the entry. */
|
|
854
|
+
name: string
|
|
855
|
+
/** The value of the entry. */
|
|
856
|
+
value: string
|
|
857
|
+
}
|
|
844
858
|
/** The stack trace result */
|
|
845
859
|
export interface StackTrace {
|
|
846
860
|
/** Enum tag for JS. */
|
|
@@ -1365,6 +1379,13 @@ export declare class TestResult {
|
|
|
1365
1379
|
readonly kind: StandardTestKind | FuzzTestKind | InvariantTestKind
|
|
1366
1380
|
/** See [edr_solidity_tests::result::TestResult::duration] */
|
|
1367
1381
|
readonly durationNs: bigint
|
|
1382
|
+
/**
|
|
1383
|
+
* Groups of value snapshot entries (incl. gas).
|
|
1384
|
+
*
|
|
1385
|
+
* Only present if the test runner collected scoped snapshots. Currently,
|
|
1386
|
+
* this is always the case.
|
|
1387
|
+
*/
|
|
1388
|
+
readonly valueSnapshotGroups?: Array<ValueSnapshotGroup>
|
|
1368
1389
|
/**
|
|
1369
1390
|
* Compute the error stack trace.
|
|
1370
1391
|
* The result is either the stack trace or the reason why we couldn't
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/edr",
|
|
3
|
-
"version": "0.12.0-next.
|
|
3
|
+
"version": "0.12.0-next.1",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@napi-rs/cli": "^2.18.4",
|
|
6
6
|
"@nomicfoundation/ethereumjs-util": "^9.0.4",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"repository": "NomicFoundation/edr.git",
|
|
55
55
|
"types": "index.d.ts",
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@nomicfoundation/edr-darwin-arm64": "0.12.0-next.
|
|
58
|
-
"@nomicfoundation/edr-darwin-x64": "0.12.0-next.
|
|
59
|
-
"@nomicfoundation/edr-linux-arm64-gnu": "0.12.0-next.
|
|
60
|
-
"@nomicfoundation/edr-linux-arm64-musl": "0.12.0-next.
|
|
61
|
-
"@nomicfoundation/edr-linux-x64-gnu": "0.12.0-next.
|
|
62
|
-
"@nomicfoundation/edr-linux-x64-musl": "0.12.0-next.
|
|
63
|
-
"@nomicfoundation/edr-win32-x64-msvc": "0.12.0-next.
|
|
57
|
+
"@nomicfoundation/edr-darwin-arm64": "0.12.0-next.1",
|
|
58
|
+
"@nomicfoundation/edr-darwin-x64": "0.12.0-next.1",
|
|
59
|
+
"@nomicfoundation/edr-linux-arm64-gnu": "0.12.0-next.1",
|
|
60
|
+
"@nomicfoundation/edr-linux-arm64-musl": "0.12.0-next.1",
|
|
61
|
+
"@nomicfoundation/edr-linux-x64-gnu": "0.12.0-next.1",
|
|
62
|
+
"@nomicfoundation/edr-linux-x64-musl": "0.12.0-next.1",
|
|
63
|
+
"@nomicfoundation/edr-win32-x64-msvc": "0.12.0-next.1"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"artifacts": "napi artifacts",
|
|
@@ -22,6 +22,26 @@ use crate::{
|
|
|
22
22
|
trace::{solidity_stack_trace::SolidityStackTraceEntry, u256_to_bigint},
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/// A grouping of value snapshot entries for a test.
|
|
26
|
+
#[napi(object)]
|
|
27
|
+
#[derive(Clone, Debug)]
|
|
28
|
+
pub struct ValueSnapshotGroup {
|
|
29
|
+
/// The group name.
|
|
30
|
+
pub name: String,
|
|
31
|
+
/// The entries in the group.
|
|
32
|
+
pub entries: Vec<ValueSnapshotEntry>,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// An entry in a value snapshot group.
|
|
36
|
+
#[napi(object)]
|
|
37
|
+
#[derive(Clone, Debug)]
|
|
38
|
+
pub struct ValueSnapshotEntry {
|
|
39
|
+
/// The name of the entry.
|
|
40
|
+
pub name: String,
|
|
41
|
+
/// The value of the entry.
|
|
42
|
+
pub value: String,
|
|
43
|
+
}
|
|
44
|
+
|
|
25
45
|
/// See [edr_solidity_tests::result::SuiteResult]
|
|
26
46
|
#[napi]
|
|
27
47
|
#[derive(Clone, Debug)]
|
|
@@ -85,6 +105,12 @@ pub struct TestResult {
|
|
|
85
105
|
/// See [edr_solidity_tests::result::TestResult::duration]
|
|
86
106
|
#[napi(readonly)]
|
|
87
107
|
pub duration_ns: BigInt,
|
|
108
|
+
/// Groups of value snapshot entries (incl. gas).
|
|
109
|
+
///
|
|
110
|
+
/// Only present if the test runner collected scoped snapshots. Currently,
|
|
111
|
+
/// this is always the case.
|
|
112
|
+
#[napi(readonly)]
|
|
113
|
+
pub value_snapshot_groups: Option<Vec<ValueSnapshotGroup>>,
|
|
88
114
|
|
|
89
115
|
stack_trace_result: Option<Arc<StackTraceResult<String>>>,
|
|
90
116
|
call_trace_arenas: Vec<(traces::TraceKind, SparsedTraceArena)>,
|
|
@@ -264,6 +290,19 @@ impl TestResult {
|
|
|
264
290
|
}),
|
|
265
291
|
},
|
|
266
292
|
duration_ns: BigInt::from(test_result.duration.as_nanos()),
|
|
293
|
+
value_snapshot_groups: Some(
|
|
294
|
+
test_result
|
|
295
|
+
.value_snapshots
|
|
296
|
+
.into_iter()
|
|
297
|
+
.map(|(group_name, entries)| ValueSnapshotGroup {
|
|
298
|
+
name: group_name,
|
|
299
|
+
entries: entries
|
|
300
|
+
.into_iter()
|
|
301
|
+
.map(|(name, value)| ValueSnapshotEntry { name, value })
|
|
302
|
+
.collect(),
|
|
303
|
+
})
|
|
304
|
+
.collect(),
|
|
305
|
+
),
|
|
267
306
|
stack_trace_result: test_result.stack_trace_result.map(Arc::new),
|
|
268
307
|
call_trace_arenas: if include_trace {
|
|
269
308
|
test_result.traces
|