Modify decoding

This commit is contained in:
Paul Hauner
2021-09-22 09:59:59 +10:00
parent 7433385fb3
commit ac1cdc5ca4
2 changed files with 17 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ pub enum Error {
BadResponse(String),
RequestFailed(String),
JsonRpc(RpcError),
Json(serde_json::Error),
}
impl From<reqwest::Error> for Error {
@@ -21,6 +22,12 @@ impl From<reqwest::Error> for Error {
}
}
impl From<serde_json::Error> for Error {
fn from(e: serde_json::Error) -> Self {
Error::Json(e)
}
}
#[async_trait]
pub trait EngineApi {
async fn upcheck(&self) -> Result<(), Error>;