Compare commits
2 Commits
c831bd5c35
...
e03937041b
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | e03937041b | |
Derrick Hammer | 28ab6ca4fd |
|
@ -75,32 +75,6 @@ impl From<wasm_bindgen::JsValue> for JsonRpcError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Result<String, ()>> for ClientError {
|
||||
fn from(result: Result<String, ()>) -> Self {
|
||||
match result {
|
||||
Ok(msg) => ClientError::JsonRpcError(JsonRpcError {
|
||||
code: 0,
|
||||
message: msg,
|
||||
data: None,
|
||||
}),
|
||||
Err(_) => ClientError::JsonRpcError(JsonRpcError {
|
||||
code: 0,
|
||||
message: "response is not a string".to_string(),
|
||||
data: None,
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<()> for HttpClientError {
|
||||
fn from(_: ()) -> Self {
|
||||
HttpClientError::JsonRpcError(JsonRpcError {
|
||||
code: 0,
|
||||
message: "".to_string(),
|
||||
data: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
||||
impl JsonRpcClient for Provider {
|
||||
|
|
Loading…
Reference in New Issue