Skip to content

Commit

Permalink
Merge branch 'main' into transactions-db-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio authored Jun 13, 2024
2 parents c1620d2 + 2570fd2 commit dbe9bcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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
5 changes: 4 additions & 1 deletion cmd/soroban-rpc/internal/methods/get_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ func GetTransaction(
log.WithError(err).
WithField("hash", txHash).
Errorf("failed to fetch transaction")
return response, err
return response, &jrpc2.Error{
Code: jrpc2.InternalError,
Message: err.Error(),
}
}

response.ApplicationOrder = tx.ApplicationOrder
Expand Down

0 comments on commit dbe9bcd

Please sign in to comment.