From b2ab8f59071e29239e848c7ff405f318a338ce99 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Thu, 6 Jun 2024 16:54:57 +0900 Subject: [PATCH] use static timestamp example (#1660) --- apps/hermes/Cargo.lock | 2 +- apps/hermes/Cargo.toml | 2 +- apps/hermes/src/api/doc_examples.rs | 13 ++----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/hermes/Cargo.lock b/apps/hermes/Cargo.lock index 1c3356ea64..ae48fd4934 100644 --- a/apps/hermes/Cargo.lock +++ b/apps/hermes/Cargo.lock @@ -1796,7 +1796,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermes" -version = "0.5.10" +version = "0.5.11" dependencies = [ "anyhow", "async-trait", diff --git a/apps/hermes/Cargo.toml b/apps/hermes/Cargo.toml index 158cf6d914..1ce9053408 100644 --- a/apps/hermes/Cargo.toml +++ b/apps/hermes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hermes" -version = "0.5.10" +version = "0.5.11" description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle." edition = "2021" diff --git a/apps/hermes/src/api/doc_examples.rs b/apps/hermes/src/api/doc_examples.rs index 2ee4e82ebf..7ae4efa535 100644 --- a/apps/hermes/src/api/doc_examples.rs +++ b/apps/hermes/src/api/doc_examples.rs @@ -13,17 +13,8 @@ pub fn price_feed_id_example() -> &'static str { /// Example value for a unix timestamp pub fn timestamp_example() -> UnixTimestamp { - use std::time::{ - SystemTime, - UNIX_EPOCH, - }; - - let start = SystemTime::now(); - let since_the_epoch = start - .duration_since(UNIX_EPOCH) - .expect("Time went backwards"); - - since_the_epoch.as_secs() as UnixTimestamp + const STATIC_UNIX_TIMESTAMP: UnixTimestamp = 1717632000; // Thursday, 6 June 2024 00:00:00 GMT + STATIC_UNIX_TIMESTAMP } /// Example value for a VAA