diff --git a/sube/src/builder.rs b/sube/src/builder.rs index 6d6ca37..9910b82 100644 --- a/sube/src/builder.rs +++ b/sube/src/builder.rs @@ -204,12 +204,12 @@ async fn get_multi_backend_by_url<'a>( let backend = Box::new(get_backend_by_url(url.clone()).await?); let backend = Box::leak::<'static>(backend); - instance_backend.insert(base_path.clone(), backend); + instance_backend.insert(base_path.clone(), backend).map_err(|_| Error::CantInitBackend)?; let metadata = Box::new(get_metadata(backend, metadata).await?); let metadata = Box::leak::<'static>(metadata); - instance_metadata.insert(base_path.clone(), metadata); + instance_metadata.insert(base_path.clone(), metadata).map_err(|_| Error::BadMetadata)?; Ok((backend, metadata)) } diff --git a/sube/src/lib.rs b/sube/src/lib.rs index c7d9315..d8ac9e9 100644 --- a/sube/src/lib.rs +++ b/sube/src/lib.rs @@ -488,6 +488,7 @@ pub enum Error { AccountNotFound, ConstantNotFound(String), Platform(String), + CantInitBackend } impl fmt::Display for Error { diff --git a/sube/src/rpc.rs b/sube/src/rpc.rs index 58cfef8..62f520e 100644 --- a/sube/src/rpc.rs +++ b/sube/src/rpc.rs @@ -106,9 +106,10 @@ impl Backend for RpcClient { log::debug!("Extrinsic: {}", extrinsic); self.0 - .rpc("author_submitExtrinsic", &[&format!("\"{}\"", &extrinsic)]) + .rpc::("author_submitExtrinsic", &[&format!("\"{}\"", &extrinsic)]) .await .map_err(|e| crate::Error::Node(e.to_string()))?; + Ok(()) }