Browse Source
Use `OracleEventId` instead of `String` for `Attestation` id
feature/integration-tests
Daniel Karzel
3 years ago
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E
4 changed files with
5 additions and
5 deletions
-
daemon/src/maker_cfd.rs
-
daemon/src/monitor.rs
-
daemon/src/oracle.rs
-
daemon/src/taker_cfd.rs
|
|
@ -606,7 +606,7 @@ impl Actor { |
|
|
|
async fn handle_oracle_attestation(&mut self, attestation: oracle::Attestation) -> Result<()> { |
|
|
|
tracing::debug!( |
|
|
|
"Learnt latest oracle attestation for event: {}", |
|
|
|
attestation.id |
|
|
|
attestation.id.0 |
|
|
|
); |
|
|
|
|
|
|
|
todo!( |
|
|
|
|
|
@ -222,7 +222,7 @@ where |
|
|
|
async fn handle_oracle_attestation(&mut self, attestation: oracle::Attestation) -> Result<()> { |
|
|
|
for (order_id, MonitorParams { cets, .. }) in self.cfds.clone().into_iter() { |
|
|
|
let cets = cets |
|
|
|
.get(&attestation.id) |
|
|
|
.get(&attestation.id.0) |
|
|
|
.context("No CET for oracle event found")?; |
|
|
|
let (txid, script_pubkey) = |
|
|
|
match cets.iter().find_map(|(txid, script_pubkey, range)| { |
|
|
|
|
|
@ -216,7 +216,7 @@ pub struct Announcements(pub [Announcement; 24]); |
|
|
|
#[derive(Debug, Clone, serde::Deserialize, PartialEq)] |
|
|
|
#[serde(try_from = "olivia_api::Response")] |
|
|
|
pub struct Attestation { |
|
|
|
pub id: String, |
|
|
|
pub id: OracleEventId, |
|
|
|
pub price: u64, |
|
|
|
pub scalars: Vec<SecretKey>, |
|
|
|
} |
|
|
@ -270,7 +270,7 @@ mod olivia_api { |
|
|
|
let attestation = response.attestation.context("Missing attestation")?; |
|
|
|
|
|
|
|
Ok(Self { |
|
|
|
id: data.id, |
|
|
|
id: OracleEventId(data.id), |
|
|
|
price: attestation.outcome.parse()?, |
|
|
|
scalars: attestation.schemes.olivia_v1.scalars, |
|
|
|
}) |
|
|
|
|
|
@ -444,7 +444,7 @@ impl Actor { |
|
|
|
async fn handle_oracle_attestation(&mut self, attestation: oracle::Attestation) -> Result<()> { |
|
|
|
tracing::debug!( |
|
|
|
"Learnt latest oracle attestation for event: {}", |
|
|
|
attestation.id |
|
|
|
attestation.id.0 |
|
|
|
); |
|
|
|
|
|
|
|
todo!( |
|
|
|