Skip to content

Commit

Permalink
use static timestamp example (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel authored Jun 6, 2024
1 parent 98a02e3 commit b2ab8f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/hermes/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/hermes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
13 changes: 2 additions & 11 deletions apps/hermes/src/api/doc_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2ab8f5

Please sign in to comment.