Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Aug 17, 2023
1 parent 217c820 commit f50f196
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions chains/ethereum/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,18 @@ impl BlockchainClient for EthereumClient {
}

async fn finalized_block(&self) -> Result<BlockIdentifier> {
let block = self
if let Some(block) = self
.client
.get_block(BlockId::Number(BlockNumber::Finalized))
.await?
.context("missing block")?;
Ok(BlockIdentifier {
index: block.number.context("Block is pending")?.as_u64(),
hash: hex::encode(block.hash.as_ref().unwrap()),
})
{
Ok(BlockIdentifier {
index: block.number.context("Block is pending")?.as_u64(),
hash: hex::encode(block.hash.as_ref().unwrap()),
})
} else {
Ok(self.genesis_block.clone())
}
}

async fn balance(&self, address: &Address, block: &BlockIdentifier) -> Result<u128> {
Expand Down

0 comments on commit f50f196

Please sign in to comment.