Browse Source

Fix URl to fetch attestations

`https://h00.ooo//x/BitMEX/BXBT/2021-10-08T03:00:00.price[n:20]` for attestations because the event includes a leading slash.
Fixed by removing it from the base url and adding a specific slash when fetching events.
compile-for-aarch64
Daniel Karzel 3 years ago
parent
commit
dc6f5703e4
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 4
      daemon/src/oracle.rs

4
daemon/src/oracle.rs

@ -15,7 +15,7 @@ use std::collections::HashSet;
use std::convert::TryFrom;
/// Where `olivia` is located.
const OLIVIA_URL: &str = "https://h00.ooo/";
const OLIVIA_URL: &str = "https://h00.ooo";
const OLIVIA_EVENT_TIME_FORMAT: &[FormatItem] =
format_description!("[year]-[month]-[day]T[hour]:[minute]:[second]");
@ -231,7 +231,7 @@ fn event_url(datetime: OffsetDateTime) -> String {
.format(&OLIVIA_EVENT_TIME_FORMAT)
.expect("valid formatter for datetime");
format!("{}x/BitMEX/BXBT/{}.price[n:20]", OLIVIA_URL, datetime)
format!("{}/x/BitMEX/BXBT/{}.price[n:20]", OLIVIA_URL, datetime)
}
#[derive(Debug, Clone, serde::Deserialize, PartialEq)]

Loading…
Cancel
Save