Skip to content

Commit

Permalink
fix: return GetTransactionResponse correctly with getTransaction (#213)
Browse files Browse the repository at this point in the history
Co-authored-by: Leigh McCulloch <[email protected]>
  • Loading branch information
willemneal and leighmcculloch authored Jun 13, 2024
1 parent f0799bf commit 2570fd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/crates/stellar-rpc-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,9 @@ impl Client {
pub async fn get_transaction(&self, tx_id: &Hash) -> Result<GetTransactionResponse, Error> {
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.
Expand Down

0 comments on commit 2570fd2

Please sign in to comment.