Revert "Resolve JSON RPC 2.0 non-compliance ()" ()

This reverts commit 15278021dc.
This commit is contained in:
Quentin Le Sceller 2020-01-28 17:45:38 -05:00 committed by GitHub
parent 15278021dc
commit 83a2649946
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,17 +52,9 @@ type Tx = mpsc::UnboundedSender<String>;
// http://www.jsonrpc.org/specification
// RPC Methods
/// Represents a compliant JSON RPC 2.0 id.
/// Valid id: Integer, String.
#[derive(Serialize, Deserialize, Debug)]
enum JsonId {
NumId(u32),
StrId(String),
}
#[derive(Serialize, Deserialize, Debug)]
struct RpcRequest {
id: JsonId,
id: String,
jsonrpc: String,
method: String,
params: Option<Value>,
@ -70,7 +62,7 @@ struct RpcRequest {
#[derive(Serialize, Deserialize, Debug)]
struct RpcResponse {
id: JsonId,
id: String,
jsonrpc: String,
method: String,
result: Option<Value>,
@ -509,7 +501,7 @@ impl Handler {
// Issue #1159 - use a serde_json Value type to avoid extra quoting
let job_template_value: Value = serde_json::from_str(&job_template_json).unwrap();
let job_request = RpcRequest {
id: JsonId::StrId(String::from("Stratum")),
id: String::from("Stratum"),
jsonrpc: String::from("2.0"),
method: String::from("job"),
params: Some(job_template_value),