From 63c43423f3d374018260673279aaf3b9eec4488b 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 a0b40a8137..64c0b9169b 100644 --- a/sdk/src/client/node_api/core/routes.rs +++ b/sdk/src/client/node_api/core/routes.rs @@ -308,10 +308,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.