From 124a27187458a71d43ec24fc400357de5c705dee Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Tue, 12 Nov 2024 14:30:41 +0100 Subject: [PATCH] fix(apps/hermes/server): add crypto redemption rate asset type --- apps/hermes/server/Cargo.lock | 4 ++-- apps/hermes/server/Cargo.toml | 2 +- apps/hermes/server/src/api/types.rs | 14 +++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/hermes/server/Cargo.lock b/apps/hermes/server/Cargo.lock index 1ac0e51262..ef9b6e46aa 100644 --- a/apps/hermes/server/Cargo.lock +++ b/apps/hermes/server/Cargo.lock @@ -1796,7 +1796,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermes" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -3138,7 +3138,7 @@ dependencies = [ [[package]] name = "pythnet-sdk" -version = "2.3.0" +version = "2.3.1" dependencies = [ "bincode", "borsh 0.10.3", diff --git a/apps/hermes/server/Cargo.toml b/apps/hermes/server/Cargo.toml index a437da3c3d..6df64185ec 100644 --- a/apps/hermes/server/Cargo.toml +++ b/apps/hermes/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hermes" -version = "0.7.1" +version = "0.7.2" description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle." edition = "2021" diff --git a/apps/hermes/server/src/api/types.rs b/apps/hermes/server/src/api/types.rs index c9af0e631a..f92c44ff8d 100644 --- a/apps/hermes/server/src/api/types.rs +++ b/apps/hermes/server/src/api/types.rs @@ -326,17 +326,25 @@ pub struct PriceFeedMetadata { } #[derive(Debug, Serialize, Deserialize, PartialEq, ToSchema)] -#[serde(rename_all = "lowercase")] pub enum AssetType { Crypto, FX, Equity, - Metals, + Metal, Rates, + #[serde(rename = "Crypto Redemption Rate")] + CryptoRedemptionRate, } impl Display for AssetType { fn fmt(&self, f: &mut Formatter) -> FmtResult { - write!(f, "{:?}", self) + match self { + AssetType::Crypto => write!(f, "Crypto"), + AssetType::FX => write!(f, "FX"), + AssetType::Equity => write!(f, "Equity"), + AssetType::Metal => write!(f, "Metal"), + AssetType::Rates => write!(f, "Rates"), + AssetType::CryptoRedemptionRate => write!(f, "Crypto Redemption Rate"), + } } }