Skip to content

Commit

Permalink
chore: update alloy (foundry-rs#6857)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 19, 2024
1 parent d6612e3 commit 77e977f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions crates/anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,9 @@ impl EthApi {
if let Some(fork) = self.get_fork() {
if fork.predates_fork(number) {
return Ok(B256::from(
fork.storage_at(
address,
B256::from(index),
Some(BlockNumber::Number(number)),
)
.await
.map_err(|_| BlockchainError::DataUnavailable)?,
fork.storage_at(address, index, Some(BlockNumber::Number(number)))
.await
.map_err(|_| BlockchainError::DataUnavailable)?,
));
}
}
Expand Down
5 changes: 2 additions & 3 deletions crates/anvil/src/eth/backend/fork.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Support for forking off another client
use crate::eth::{backend::db::Db, error::BlockchainError};
use alloy_primitives::{Address, Bytes, StorageKey, StorageValue, B256, U256, U64};
use alloy_primitives::{Address, Bytes, StorageValue, B256, U256, U64};
use alloy_providers::provider::TempProvider;
use alloy_rpc_trace_types::{
geth::{GethDebugTracingOptions, GethTrace},
Expand Down Expand Up @@ -238,10 +238,9 @@ impl ClientFork {
pub async fn storage_at(
&self,
address: Address,
index: StorageKey,
index: U256,
number: Option<BlockNumber>,
) -> Result<StorageValue, TransportError> {
let index = B256::from(index);
self.provider().get_storage_at(address, index, number.map(Into::into)).await
}

Expand Down
4 changes: 1 addition & 3 deletions crates/evm/core/src/fork/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ where
let provider = self.provider.clone();
let block_id = self.block_id;
let fut = Box::pin(async move {
// serialize & deserialize back to U256
let idx_req = B256::from(idx);
let storage = provider.get_storage_at(address, idx_req, block_id).await;
let storage = provider.get_storage_at(address, idx, block_id).await;
(storage.wrap_err("could not fetch slot {idx} from {address}"), address, idx)
});
self.pending_requests.push(ProviderRequest::Storage(fut));
Expand Down

0 comments on commit 77e977f

Please sign in to comment.