From a68752a62a645015450503123d007c4a8eb39023 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 12 Dec 2022 13:06:56 +0000 Subject: [PATCH] rpc: Improve debuging of chainHead_call wappers Signed-off-by: Alexandru Vasile --- subxt/src/rpc/rpc.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/subxt/src/rpc/rpc.rs b/subxt/src/rpc/rpc.rs index e6396d82f9..f0dcd6aa40 100644 --- a/subxt/src/rpc/rpc.rs +++ b/subxt/src/rpc/rpc.rs @@ -858,7 +858,13 @@ impl Rpc { .map_err(|err| Error::Other(err.to_string()))?; Ok(bytes) } - _ => Err(Error::Other("Failed to execute runtime API call".into())), + event => { + println!( + "Substrate failed to execute the runtime API call. Event={:?}", + event + ); + return Err(Error::Other("Failed to execute runtime API call".into())) + } } } @@ -905,10 +911,7 @@ impl Rpc { let _result: bool = self .client - .request( - "chainHead_unstable_unfollow", - rpc_params![subscription_id], - ) + .request("chainHead_unstable_unfollow", rpc_params![subscription_id]) .await?; (bytes, event)