Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update alloy #6857

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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