From e3354d400baafc49050c375704c681c36198b0f7 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Mon, 26 Jun 2023 11:54:27 +0200 Subject: [PATCH] Use get_output_raw --- sdk/src/client/node_api/core/routes.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/src/client/node_api/core/routes.rs b/sdk/src/client/node_api/core/routes.rs index 0bbcb65228..14b32eaf9f 100644 --- a/sdk/src/client/node_api/core/routes.rs +++ b/sdk/src/client/node_api/core/routes.rs @@ -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 { - 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.