revme/cmd/eofvalidation/
test_suite.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use revm::primitives::Bytes;
use serde::Deserialize;
use std::collections::BTreeMap;

#[derive(Debug, PartialEq, Eq, Deserialize)]
pub struct TestSuite(pub BTreeMap<String, TestUnit>);

#[derive(Debug, PartialEq, Eq, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct TestUnit {
    #[serde(default, rename = "_info")]
    pub info: Option<serde_json::Value>,
    #[serde(default)]
    pub vectors: BTreeMap<String, TestVector>,
}

#[derive(Debug, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct TestVector {
    pub code: Bytes,
    pub container_kind: Option<String>,
    pub results: PragueTestResult,
}

#[derive(Debug, PartialEq, Eq, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct PragueTestResult {
    #[serde(rename = "Prague")]
    pub prague: TestResult,
}

#[derive(Debug, PartialEq, Eq, Deserialize)]
pub struct TestResult {
    pub result: bool,
    pub exception: Option<String>,
}