Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ jobs:
ethtests/EIPTests/StateTests/stEIP2537/ \
tests/eof_suite/state_tests \
tests/prague_suite/state_tests
- name: Run EOF validation tests
run: |
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- eof-validation \
tests/eof_suite/eof_tests/prague

15 changes: 8 additions & 7 deletions bins/revme/src/cmd/eofvalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ mod test_suite;
pub use test_suite::{PragueTestResult, TestResult, TestSuite, TestUnit, TestVector};

use crate::{cmd::Error, dir_utils::find_all_json_tests};
use revm::{
interpreter::analysis::{validate_raw_eof, EofError},
primitives::Eof,
};
use revm::interpreter::analysis::{validate_raw_eof_inner, CodeType, EofError};
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use structopt::StructOpt;
Expand Down Expand Up @@ -48,11 +45,15 @@ pub fn run_test(path: &Path) {
for (name, test_unit) in suite.0 {
for (vector_name, test_vector) in test_unit.vectors {
test_sum += 1;
let res = validate_raw_eof(test_vector.code.clone());
let kind = if test_vector.container_kind.is_some() {
Some(CodeType::ReturnContract)
} else {
None
};
let res = validate_raw_eof_inner(test_vector.code.clone(), kind);
if res.is_ok() != test_vector.results.prague.result {
let eof = Eof::decode(test_vector.code.clone());
println!(
"\nTest failed: {} - {}\nresult:{:?}\nrevm err_result:{:#?}\nbytes:{:?}\n,eof:{eof:#?}",
"\nTest failed: {} - {}\nresult:{:?}\nrevm err_result:{:#?}\nbytes:{:?}\n",
name,
vector_name,
test_vector.results.prague,
Expand Down
3 changes: 2 additions & 1 deletion bins/revme/src/cmd/eofvalidation/test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ pub struct TestUnit {
}

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

Expand Down
Loading