()
| 502 | |
| 503 | #[test] |
| 504 | fn test_empty_result() { |
| 505 | // Check that we correctly deserialize an empty result. |
| 506 | #[derive(Debug, Serialize, Deserialize, PartialEq)] |
| 507 | pub struct DummyResponse {} |
| 508 | |
| 509 | let json_response = r#" |
| 510 | { |
| 511 | "jsonrpc": "2.0", |
| 512 | "result": {}, |
| 513 | "id": "unique-id-123" |
| 514 | }"#; |
| 515 | |
| 516 | let response: JsonRpcResponse<DummyResponse> = serde_json::from_str(json_response).unwrap(); |
| 517 | let result = response.into_result().unwrap(); |
| 518 | assert_eq!(result, DummyResponse {}); |
| 519 | } |
| 520 | #[test] |
| 521 | fn test_error_deserialization() { |
| 522 | // Check that we deserialize an error if we got one. |
nothing calls this directly
no test coverage detected