Skip to content

Commit

Permalink
test(ethexe): append ping_reorg test (#4090)
Browse files Browse the repository at this point in the history
  • Loading branch information
grishasobol authored Jul 29, 2024
1 parent d954e57 commit c5dc31a
Show file tree
Hide file tree
Showing 6 changed files with 457 additions and 56 deletions.
10 changes: 9 additions & 1 deletion ethexe/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl Service {
Ok(commitments)
}

pub async fn run(self) -> Result<()> {
async fn run_inner(self) -> Result<()> {
let Service {
db,
network,
Expand Down Expand Up @@ -468,6 +468,7 @@ impl Service {
}
}

log::trace!("Sending timeout after observer event...");
delay = Some(tokio::time::sleep(block_time / 4));
}
_ = maybe_await(delay.take()) => {
Expand Down Expand Up @@ -507,6 +508,13 @@ impl Service {

Ok(())
}

pub async fn run(self) -> Result<()> {
self.run_inner().await.map_err(|err| {
log::error!("Service finished work with error: {:?}", err);
err
})
}
}

pub async fn maybe_await<F: Future>(f: Option<F>) -> F::Output {
Expand Down
Loading

0 comments on commit c5dc31a

Please sign in to comment.