Skip to content

Commit

Permalink
remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Nov 30, 2024
1 parent f7c2f1f commit 1e08603
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/katana/pipeline/src/stage/sequencing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use katana_pool::{TransactionPool, TxPool};
use katana_tasks::{TaskHandle, TaskSpawner};
use tracing::error;

pub type SequencingFut = BoxFuture<'static, ()>;
pub type SequencingFut = BoxFuture<'static, Result<()>>;

/// The sequencing stage is responsible for advancing the chain state.
#[allow(missing_debug_implementations)]
Expand Down Expand Up @@ -62,13 +62,13 @@ impl<EF: ExecutorFactory> Sequencing<EF> {
}

impl<EF: ExecutorFactory> IntoFuture for Sequencing<EF> {
type Output = ();
type Output = Result<()>;
type IntoFuture = SequencingFut;

fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
// Build the messaging and block production tasks.
let messaging = self.run_messaging().await.unwrap();
let messaging = self.run_messaging().await?;
let block_production = self.run_block_production();

// Neither of these tasks should complete as they are meant to be run forever,
Expand All @@ -83,6 +83,8 @@ impl<EF: ExecutorFactory> IntoFuture for Sequencing<EF> {
error!(target: "sequencing", reason = ?res, "Block production task finished unexpectedly.");
}
}

Ok(())

Check warning on line 87 in crates/katana/pipeline/src/stage/sequencing.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/pipeline/src/stage/sequencing.rs#L87

Added line #L87 was not covered by tests
})
}
}

0 comments on commit 1e08603

Please sign in to comment.