diff --git a/frame/evm/test-vector-support/src/lib.rs b/frame/evm/test-vector-support/src/lib.rs index bfa41719b4..4ec3fbdee1 100644 --- a/frame/evm/test-vector-support/src/lib.rs +++ b/frame/evm/test-vector-support/src/lib.rs @@ -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(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 = serde_json::from_str(&data).expect("expected json array"); @@ -163,7 +164,8 @@ pub fn test_precompile_test_vectors(filepath: &str) -> Result<(), } pub fn test_precompile_failure_test_vectors(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 = serde_json::from_str(&data).expect("expected json array");