Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add correct filepath to test_precompile_test_vectors* expect #1083

Merged
merged 1 commit into from
Jul 30, 2023
Merged
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
6 changes: 4 additions & 2 deletions frame/evm/test-vector-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ impl PrecompileHandle for MockHandle {
/// The file is expected to be in JSON format and contain an array of test vectors, where each
/// vector can be deserialized into an "EthConsensusTest".
pub fn test_precompile_test_vectors<P: Precompile>(filepath: &str) -> Result<(), String> {
let data = fs::read_to_string(filepath).expect("Failed to read blake2F.json");
let data =
fs::read_to_string(filepath).unwrap_or_else(|_| panic!("Failed to read {}", filepath));

let tests: Vec<EthConsensusTest> = serde_json::from_str(&data).expect("expected json array");

Expand Down Expand Up @@ -163,7 +164,8 @@ pub fn test_precompile_test_vectors<P: Precompile>(filepath: &str) -> Result<(),
}

pub fn test_precompile_failure_test_vectors<P: Precompile>(filepath: &str) -> Result<(), String> {
let data = fs::read_to_string(filepath).expect("Failed to read json file");
let data =
fs::read_to_string(filepath).unwrap_or_else(|_| panic!("Failed to read {}", filepath));

let tests: Vec<EthConsensusFailureTest> =
serde_json::from_str(&data).expect("expected json array");
Expand Down