Skip to content

Commit

Permalink
add processed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfirefist committed May 15, 2024
1 parent 563c4ba commit ae20dfa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/fortuna/src/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ pub async fn process_event(
fulfilled_requests_cache: Arc<RwLock<HashMap<u64, RequestState>>>,
) -> Result<()> {
if chain_config.provider_address != event.provider_address {
fulfilled_requests_cache
.write()
.await
.insert(event.sequence_number, RequestState::Fulfilled);
return Ok(());
}
let provider_revelation = match chain_config.state.reveal(event.sequence_number) {
Expand Down Expand Up @@ -390,6 +394,10 @@ pub async fn process_event(
// ever. We will return an Ok(()) to signal that we have processed this reveal
// and concluded that its Ok to not reveal.
_ => {
fulfilled_requests_cache
.write()
.await
.insert(event.sequence_number, RequestState::Processed);
tracing::error!(
sequence_number = &event.sequence_number,
"Error while revealing with error: {:?}",
Expand Down Expand Up @@ -466,8 +474,12 @@ pub async fn process_event(
None => {
tracing::info!(
sequence_number = &event.sequence_number,
"Not processing event"
"Not fulfilling event"
);
fulfilled_requests_cache
.write()
.await
.insert(event.sequence_number, RequestState::Processed);
Ok(())
}
},
Expand Down

0 comments on commit ae20dfa

Please sign in to comment.