Skip to content

Commit 421f349

Browse files
authored
fix(apps/hermes/server): use RpcPriceIdentifier instead of PriceIdentifier (#1662)
* use RpcPriceIdentifier instead of PriceIdentifier * fix test * fix imports
1 parent 83c1e43 commit 421f349

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

apps/hermes/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/hermes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hermes"
3-
version = "0.5.11"
3+
version = "0.5.12"
44
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
55
edition = "2021"
66

apps/hermes/src/api/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl TryFrom<PriceUpdate> for PriceFeedsWithUpdateData {
327327

328328
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
329329
pub struct PriceFeedMetadata {
330-
pub id: PriceIdentifier,
330+
pub id: RpcPriceIdentifier,
331331
// BTreeMap is used to automatically sort the keys to ensure consistent ordering of attributes in the JSON response.
332332
// This enhances user experience by providing a predictable structure, avoiding confusion from varying orders in different responses.
333333
pub attributes: BTreeMap<String, String>,

apps/hermes/src/network/pythnet.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
55
use {
66
crate::{
7-
api::types::PriceFeedMetadata,
7+
api::types::{
8+
PriceFeedMetadata,
9+
RpcPriceIdentifier,
10+
},
811
config::RunOptions,
912
network::wormhole::{
1013
BridgeData,
@@ -30,7 +33,6 @@ use {
3033
},
3134
borsh::BorshDeserialize,
3235
futures::stream::StreamExt,
33-
pyth_sdk::PriceIdentifier,
3436
pyth_sdk_solana::state::{
3537
load_mapping_account,
3638
load_product_account,
@@ -442,7 +444,7 @@ async fn fetch_price_feeds_metadata(
442444
.expect("Invalid length for PriceIdentifier");
443445

444446
let price_feed_metadata = PriceFeedMetadata {
445-
id: PriceIdentifier::new(px_pkey_array),
447+
id: RpcPriceIdentifier::new(px_pkey_array),
446448
attributes,
447449
};
448450

apps/hermes/src/state/aggregate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use {
1919
WormholeMerkleState,
2020
},
2121
crate::{
22+
api::types::RpcPriceIdentifier,
2223
network::wormhole::VaaBytes,
2324
state::{
2425
benchmarks::Benchmarks,
@@ -870,7 +871,7 @@ mod test {
870871
// Add a dummy price feeds metadata
871872
state
872873
.store_price_feeds_metadata(&[PriceFeedMetadata {
873-
id: PriceIdentifier::new([100; 32]),
874+
id: RpcPriceIdentifier::new([100; 32]),
874875
attributes: Default::default(),
875876
}])
876877
.await

0 commit comments

Comments
 (0)