revm_transaction/
access_list.rsuse primitives::{Address, B256};
pub trait AccessListTrait {
fn iter(&self) -> impl Iterator<Item = (Address, impl Iterator<Item = B256>)>;
fn num_account_storages(&self) -> (usize, usize) {
let storage_num = self.iter().map(|i| i.1.count()).sum();
let account_num = self.iter().count();
(account_num, storage_num)
}
}
use specification::eip2930::AccessList;
impl AccessListTrait for AccessList {
fn iter(&self) -> impl Iterator<Item = (Address, impl Iterator<Item = B256>)> {
self.0.iter().map(|item| {
let slots = item.storage_keys.iter().copied();
(item.address, slots)
})
}
}