MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / test_parse_standard_revert

Function test_parse_standard_revert

contract-bindings/src/error_parser.rs:232–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected