diff --git a/crates/providers/src/provider.rs b/crates/providers/src/provider.rs index cb2baaf12a8..ff029b7fcff 100644 --- a/crates/providers/src/provider.rs +++ b/crates/providers/src/provider.rs @@ -854,7 +854,7 @@ mod providers_test { let fee_history = provider .get_fee_history( U256::from(utils::EIP1559_FEE_ESTIMATION_PAST_BLOCKS), - BlockNumberOrTag::Number(block_number.to()), + BlockNumberOrTag::Number(block_number), &[utils::EIP1559_FEE_ESTIMATION_REWARD_PERCENTILE], ) .await diff --git a/crates/rpc-types/src/eth/transaction/access_list.rs b/crates/rpc-types/src/eth/transaction/access_list.rs index c4a7e8d1abe..a59877ee87d 100644 --- a/crates/rpc-types/src/eth/transaction/access_list.rs +++ b/crates/rpc-types/src/eth/transaction/access_list.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{Address, U256}; +use alloy_primitives::{Address, U256, B256}; use serde::{Deserialize, Serialize}; /// A list of addresses and storage keys that the transaction plans to access. @@ -9,7 +9,7 @@ pub struct AccessListItem { /// Account addresses that would be loaded at the start of execution pub address: Address, /// Keys of storage that would be loaded at the start of execution - pub storage_keys: Vec, + pub storage_keys: Vec, } /// AccessList as defined in EIP-2930 @@ -29,12 +29,28 @@ impl AccessList { /// Consumes the type and returns an iterator over the list's addresses and storage keys. pub fn into_flatten(self) -> impl Iterator)> { - self.0.into_iter().map(|item| (item.address, item.storage_keys)) + self.0.into_iter().map(|item| { + ( + item.address, + item.storage_keys + .into_iter() + .map(|slot| U256::from_be_bytes(slot.0)) + .collect(), + ) + }) } /// Returns an iterator over the list's addresses and storage keys. - pub fn flatten(&self) -> impl Iterator + '_ { - self.0.iter().map(|item| (item.address, item.storage_keys.as_slice())) + pub fn flatten(&self) -> impl Iterator)> + '_ { + self.0.iter().map(|item| { + ( + item.address, + item.storage_keys + .iter() + .map(|slot| U256::from_be_bytes(slot.0)) + .collect(), + ) + }) } } @@ -55,8 +71,8 @@ mod tests { #[test] fn access_list_serde() { let list = AccessList(vec![ - AccessListItem { address: Address::ZERO, storage_keys: vec![U256::ZERO] }, - AccessListItem { address: Address::ZERO, storage_keys: vec![U256::ZERO] }, + AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, + AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, ]); let json = serde_json::to_string(&list).unwrap(); let list2 = serde_json::from_str::(&json).unwrap(); @@ -67,8 +83,8 @@ mod tests { fn access_list_with_gas_used() { let list = AccessListWithGasUsed { access_list: AccessList(vec![ - AccessListItem { address: Address::ZERO, storage_keys: vec![U256::ZERO] }, - AccessListItem { address: Address::ZERO, storage_keys: vec![U256::ZERO] }, + AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, + AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, ]), gas_used: U256::from(100), };