Skip to content

Commit

Permalink
fix: more accurate error message for get_latest_block_hash_and_number
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-miao committed Dec 4, 2023
1 parent 1cdadd3 commit 76125e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/provider/src/ethers/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ impl<C: JsonRpcClient + 'static> Provider for EthersProvider<C> {
async fn get_latest_block_hash_and_number(&self) -> ProviderResult<(H256, U64)> {
let latest_block = Middleware::get_block(self, BlockId::Number(BlockNumber::Latest))
.await
.context("should load block to get hash")?
.context("block should exist to get latest hash")?;
.context("should load block to get hash and number")?
.context("block should exist to get latest hash and number")?;
Ok((
latest_block
.hash
Expand Down

0 comments on commit 76125e0

Please sign in to comment.