()
| 230 | |
| 231 | #[test] |
| 232 | fn test_parse_standard_revert() { |
| 233 | // Standard Solidity Error(string) with message "This is a test error message" |
| 234 | let revert_string = "08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a5468697320697320612074657374206572726f72206d6573736167650000000000"; |
| 235 | |
| 236 | let result = ContractErrorParser::parse_from_hex_str(revert_string).unwrap(); |
| 237 | assert_eq!(result.name, "RevertString"); |
| 238 | assert!(matches!( |
| 239 | result.error_type, |
| 240 | crate::error_parser::ErrorType::StandardRevert |
| 241 | )); |
| 242 | // The message should contain "This is a test error" (may be truncated due to padding) |
| 243 | assert!(result.message.is_some()); |
| 244 | let message = result.message.unwrap(); |
| 245 | assert!(message.contains("This is a test error")); |
| 246 | } |
| 247 | |
| 248 | #[test] |
| 249 | fn test_parse_panic() { |
nothing calls this directly
no outgoing calls
no test coverage detected