Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Nov 9, 2023
1 parent 8a56c2d commit f70ccc5
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions crates/evm/core/src/fork/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,19 @@ where
let code =
provider.get_code_at(address, block_id.unwrap_or(BlockNumberOrTag::Latest.into()));
let (balance, nonce, code) = tokio::join!(balance, nonce, code);
// todo(onbjerg): there has to be a better way to transform (Res<..>, Res<..>, Res<..>) into Res<(.., .., ..)>
(
balance
.success()
.ok_or_else(|| eyre::eyre!("could not fetch balance for {address}"))
.and_then(|balance| {
Ok(nonce
.success()
.ok_or_else(|| eyre::eyre!("could not fetch nonce for {address}"))
.and_then(|nonce| {
Ok((
balance,
nonce,
code.success().ok_or_else(|| {
eyre::eyre!("could not fetch code for {address}")
})?,
))
})?)
Ok((
balance,
nonce.success().ok_or_else(|| {
eyre::eyre!("could not fetch nonce for {address}")
})?,
code.success()
.ok_or_else(|| eyre::eyre!("could not fetch code for {address}"))?,
))
}),
address,
)
Expand Down

0 comments on commit f70ccc5

Please sign in to comment.