()
| 326 | |
| 327 | #[test] |
| 328 | fn test_serialize_error_response() { |
| 329 | let response = JsonRpcResponse::error( |
| 330 | serde_json::Value::Number(1.into()), |
| 331 | ErrorCode::MethodNotFound, |
| 332 | "Method not found".to_string(), |
| 333 | ); |
| 334 | |
| 335 | let json = serde_json::to_string(&response).unwrap(); |
| 336 | assert!(json.contains("-32601")); |
| 337 | assert!(json.contains("Method not found")); |
| 338 | assert!(!json.contains("\"result\"")); |
| 339 | } |
| 340 | |
| 341 | #[test] |
| 342 | fn test_error_codes() { |