Skip to content

Commit

Permalink
chain/ethereum: Do not panic on missing block header
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter committed Mar 29, 2024
1 parent 4f89962 commit 720daa1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chain/ethereum/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,9 @@ impl TryInto<EthereumBlockWithCalls> for &Block {
type Error = Error;

fn try_into(self) -> Result<EthereumBlockWithCalls, Self::Error> {
let header = self
.header
.as_ref()
.expect("block header should always be present from gRPC Firehose");
let header = self.header.as_ref().ok_or_else(|| {
format_err!("block header should always be present from gRPC Firehose")
})?;

let block = EthereumBlockWithCalls {
ethereum_block: EthereumBlock {
Expand Down

0 comments on commit 720daa1

Please sign in to comment.