Skip to content

Commit

Permalink
Use get_output_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Jun 27, 2023
1 parent 184d65e commit e3354d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sdk/src/client/node_api/core/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,13 @@ impl ClientInner {
/// GET /api/core/v3/outputs/{outputId}
/// + GET /api/core/v3/outputs/{outputId}/metadata
pub async fn get_output_with_metadata(&self, output_id: &OutputId) -> Result<OutputWithMetadata> {
Ok(OutputWithMetadata::new(
self.get_output(output_id).await?,
self.get_output_metadata(output_id).await?,
))
let output = Output::unpack_verified(
self.get_output_raw(output_id).await?,
&self.get_protocol_parameters().await?,
)?;
let metadata = self.get_output_metadata(output_id).await?;

Ok(OutputWithMetadata::new(output, metadata))
}

/// Returns the block that was included in the ledger for a given transaction ID, as object.
Expand Down

0 comments on commit e3354d4

Please sign in to comment.