@ -63,8 +63,8 @@ pub struct Actor {
send_to_maker : Address < send_to_socket ::Actor < wire ::TakerToMaker > > ,
send_to_maker : Address < send_to_socket ::Actor < wire ::TakerToMaker > > ,
monitor_actor : Address < monitor ::Actor < Actor > > ,
monitor_actor : Address < monitor ::Actor < Actor > > ,
setup_state : SetupState ,
setup_state : SetupState ,
latest_announcement : Option < oracle ::Announcement > ,
latest_announcements : Option < oracle ::Announcements > ,
_ oracle_actor : Address < oracle ::Actor < Actor , monitor ::Actor < Actor > > > ,
oracle_actor : Address < oracle ::Actor < Actor , monitor ::Actor < Actor > > > ,
current_settlement_proposals : HashMap < OrderId , SettlementProposal > ,
current_settlement_proposals : HashMap < OrderId , SettlementProposal > ,
}
}
@ -91,8 +91,8 @@ impl Actor {
send_to_maker ,
send_to_maker ,
monitor_actor ,
monitor_actor ,
setup_state : SetupState ::None ,
setup_state : SetupState ::None ,
latest_announcement : None ,
oracle_actor ,
_oracle_actor : oracle_actor ,
latest_announcements : None ,
current_settlement_proposals : HashMap ::new ( ) ,
current_settlement_proposals : HashMap ::new ( ) ,
}
}
}
}
@ -213,18 +213,23 @@ impl Actor {
. send ( load_all_cfds ( & mut conn ) . await ? ) ? ;
. send ( load_all_cfds ( & mut conn ) . await ? ) ? ;
let cfd = load_cfd_by_order_id ( order_id , & mut conn ) . await ? ;
let cfd = load_cfd_by_order_id ( order_id , & mut conn ) . await ? ;
// let latest_announcement = self
let offer_announcements = self
// .latest_announcement
. latest_announcements
// .to_owned()
. clone ( )
// .context("Unaware of oracle's latest announcement.")?;
. context ( "No oracle announcements available" ) ? ;
let offer_announcement = offer_announcements
// self.oracle_actor
. 0
// .do_send_async(oracle::MonitorEvent {
. iter ( )
// event_id: latest_announcement.id,
. find ( | announcement | announcement . id = = cfd . order . oracle_event_id )
// })
. context ( "Order's announcement not found in list of current oracle announcements" ) ? ;
// .await?;
self . oracle_actor
. do_send_async ( oracle ::MonitorEvent {
event_id : offer_announcement . id . clone ( ) ,
} )
. await ? ;
let nonce_pks = Vec ::new ( ) ;
let nonce_pks = offer_announcement . nonce_pks . clone ( ) ;
let contract_future = setup_contract ::new (
let contract_future = setup_contract ::new (
self . send_to_maker
self . send_to_maker
@ -392,8 +397,7 @@ impl Actor {
& mut self ,
& mut self ,
announcements : oracle ::Announcements ,
announcements : oracle ::Announcements ,
) -> Result < ( ) > {
) -> Result < ( ) > {
tracing ::debug ! ( "Updating latest oracle announcements" ) ;
self . latest_announcements = Some ( announcements ) ;
self . latest_announcement = Some ( announcements . 0. last ( ) . unwrap ( ) . clone ( ) ) ;
Ok ( ( ) )
Ok ( ( ) )
}
}