From 2570fd29845bd6ad7ad02f2ee3741e0b5b0cb35b Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Wed, 12 Jun 2024 20:34:43 -0400 Subject: [PATCH] fix: return GetTransactionResponse correctly with getTransaction (#213) Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> --- cmd/crates/stellar-rpc-client/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/crates/stellar-rpc-client/src/lib.rs b/cmd/crates/stellar-rpc-client/src/lib.rs index 685914ed..799e5a00 100644 --- a/cmd/crates/stellar-rpc-client/src/lib.rs +++ b/cmd/crates/stellar-rpc-client/src/lib.rs @@ -802,7 +802,9 @@ impl Client { pub async fn get_transaction(&self, tx_id: &Hash) -> Result { let mut oparams = ObjectParams::new(); oparams.insert("hash", tx_id)?; - Ok(self.client().request("getTransaction", oparams).await?) + let resp: GetTransactionResponseRaw = + self.client().request("getTransaction", oparams).await?; + Ok(resp.try_into()?) } /// Poll the transaction status. Can provide a timeout in seconds, otherwise uses the default timeout.