(id: &str, result: serde_json::Value)
| 160 | } |
| 161 | |
| 162 | fn success_response(id: &str, result: serde_json::Value) -> Vec<u8> { |
| 163 | serde_json::to_vec(&serde_json::json!({ |
| 164 | "jsonrpc": "2.0", |
| 165 | "id": id, |
| 166 | "result": result |
| 167 | })) |
| 168 | .unwrap() |
| 169 | } |
| 170 | |
| 171 | fn error_response(id: Option<&str>, error: RpcError) -> Vec<u8> { |
| 172 | serde_json::to_vec(&serde_json::json!({ |