From 863d916ba3b575aec35f592131494f1fffa76de8 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Fri, 16 Feb 2024 12:54:02 +0900 Subject: [PATCH 1/2] remove outermost array --- hermes/src/api/rest/v2/latest_price_updates.rs | 6 +++--- hermes/src/api/rest/v2/timestamp_price_updates.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hermes/src/api/rest/v2/latest_price_updates.rs b/hermes/src/api/rest/v2/latest_price_updates.rs index 408eb0fd62..c5a4b3d5b3 100644 --- a/hermes/src/api/rest/v2/latest_price_updates.rs +++ b/hermes/src/api/rest/v2/latest_price_updates.rs @@ -66,7 +66,7 @@ fn default_true() -> bool { get, path = "/v2/updates/price/latest", responses( - (status = 200, description = "Price updates retrieved successfully", body = Vec), + (status = 200, description = "Price updates retrieved successfully", body = PriceUpdate), (status = 404, description = "Price ids not found", body = String) ), params( @@ -76,7 +76,7 @@ fn default_true() -> bool { pub async fn latest_price_updates( State(state): State, QsQuery(params): QsQuery, -) -> Result>, RestError> { +) -> Result, RestError> { let price_ids: Vec = params.ids.into_iter().map(|id| id.into()).collect(); verify_price_ids_exist(&state, &price_ids).await?; @@ -126,5 +126,5 @@ pub async fn latest_price_updates( }; - Ok(Json(vec![compressed_price_update])) + Ok(Json(compressed_price_update)) } diff --git a/hermes/src/api/rest/v2/timestamp_price_updates.rs b/hermes/src/api/rest/v2/timestamp_price_updates.rs index 4a01704d63..64ebc1cc34 100644 --- a/hermes/src/api/rest/v2/timestamp_price_updates.rs +++ b/hermes/src/api/rest/v2/timestamp_price_updates.rs @@ -79,7 +79,7 @@ fn default_true() -> bool { get, path = "/v2/updates/price/{publish_time}", responses( - (status = 200, description = "Price updates retrieved successfully", body = Vec), + (status = 200, description = "Price updates retrieved successfully", body = PriceUpdate), (status = 404, description = "Price ids not found", body = String) ), params( @@ -91,7 +91,7 @@ pub async fn timestamp_price_updates( State(state): State, Path(path_params): Path, QsQuery(query_params): QsQuery, -) -> Result>, RestError> { +) -> Result, RestError> { let price_ids: Vec = query_params.ids.into_iter().map(|id| id.into()).collect(); @@ -139,5 +139,5 @@ pub async fn timestamp_price_updates( }; - Ok(Json(vec![compressed_price_update])) + Ok(Json(compressed_price_update)) } From 2b19d85b3305c47e278f441bf239c93e524cb78c Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Fri, 16 Feb 2024 12:55:42 +0900 Subject: [PATCH 2/2] bump --- hermes/Cargo.lock | 2 +- hermes/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes/Cargo.lock b/hermes/Cargo.lock index 2f1e7e5ec6..cae4e0e859 100644 --- a/hermes/Cargo.lock +++ b/hermes/Cargo.lock @@ -1574,7 +1574,7 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermes" -version = "0.5.1" +version = "0.5.2" dependencies = [ "anyhow", "async-trait", diff --git a/hermes/Cargo.toml b/hermes/Cargo.toml index 82147fce5f..13f7f864b6 100644 --- a/hermes/Cargo.toml +++ b/hermes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hermes" -version = "0.5.1" +version = "0.5.2" description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle." edition = "2021"