Skip to content
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