From 03444d4e42661188936fdb69715cd1d2b87d4a91 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Tue, 12 Mar 2024 16:46:29 -0400 Subject: [PATCH] =?UTF-8?q?app:=20=F0=9F=A6=85=20`Consensus::end=5Fblock`?= =?UTF-8?q?=20never=20errors=20(#4011)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Consensus::end_block` never returns an `Err(_)` value, so it does not need to return a `Result`. cherry-picked out ouf #4001. --- crates/core/app/src/server/consensus.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/core/app/src/server/consensus.rs b/crates/core/app/src/server/consensus.rs index 7be28cad17..37fa3a35ef 100644 --- a/crates/core/app/src/server/consensus.rs +++ b/crates/core/app/src/server/consensus.rs @@ -85,12 +85,9 @@ impl Consensus { Request::DeliverTx(deliver_tx) => { Response::DeliverTx(self.deliver_tx(deliver_tx).instrument(span.clone()).await) } - Request::EndBlock(end_block) => Response::EndBlock( - self.end_block(end_block) - .instrument(span) - .await - .expect("end_block must succeed"), - ), + Request::EndBlock(end_block) => { + Response::EndBlock(self.end_block(end_block).instrument(span).await) + } Request::Commit => Response::Commit( self.commit() .instrument(span) @@ -218,7 +215,7 @@ impl Consensus { } } - async fn end_block(&mut self, end_block: request::EndBlock) -> Result { + async fn end_block(&mut self, end_block: request::EndBlock) -> response::EndBlock { tracing::info!(height = ?end_block.height, "ending block"); let events = self.app.end_block(&end_block).await; trace_events(&events); @@ -234,11 +231,11 @@ impl Consensus { "sending validator updates to tendermint" ); - Ok(response::EndBlock { + response::EndBlock { validator_updates, consensus_param_updates: None, events, - }) + } } async fn commit(&mut self) -> Result {