File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " jsonrpc_v2_client"
3- version = " 0.1 .0"
3+ version = " 0.2 .0"
44authors = [" jhaboic <josiphaboic@gmail.com>" ]
55edition = " 2018"
66repository = " https://github.com/BitFields/jsonrpc_v2_client"
Original file line number Diff line number Diff line change 1212let service_address = jsonrpc_v2_client :: ServiceAddress :: new (" 127.0.0.1:8082" , " /api" );
1313let method = " add" ;
1414let params = jsonrpc_v2_client :: Params ([10.5 , 20.5 ]);
15- let id = 0 ;
15+ let id = " 0 " ;
1616let request = jsonrpc_v2_client :: Request :: new (method , params , id );
1717// Without API KEY
1818let response = request . send (& service_address , None );
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ impl ServiceAddress {
9292/// let service_address = jsonrpc_v2_client::ServiceAddress::new("127.0.0.1:8082", "/api");
9393/// let method = "add";
9494/// let params = jsonrpc_v2_client::Params([10.5, 20.5]);
95- /// let id = 0 ;
95+ /// let id = "0" ;
9696/// let request = jsonrpc_v2_client::Request::new(method, params, id);
9797/// let response = request.send(&service_address, None);
9898/// println!("{}", response);
@@ -110,17 +110,17 @@ pub struct Request<T: Serialize> {
110110 jsonrpc : String ,
111111 pub method : String ,
112112 pub params : Params < T > ,
113- pub id : u64 ,
113+ pub id : String ,
114114}
115115
116116impl < T : Serialize > Request < T > {
117117
118- pub fn new ( method : & str , params : Params < T > , id : u64 ) -> Request < T > {
118+ pub fn new ( method : & str , params : Params < T > , id : & str ) -> Request < T > {
119119 Request {
120120 jsonrpc : JSONRPC_VERSION . to_string ( ) ,
121121 method : method. to_string ( ) ,
122122 params : params,
123- id : id,
123+ id : id. to_string ( ) ,
124124 }
125125 }
126126
You can’t perform that action at this time.
0 commit comments