chore: use rpc types Accesslist in inspector (#5549)

This commit is contained in:
Matthias Seitz
2023-11-23 16:40:31 +01:00
committed by GitHub
parent 5a1b0def35
commit 30f4114702
6 changed files with 35 additions and 59 deletions

View File

@ -82,3 +82,31 @@ impl AccessList {
self.0.capacity() * mem::size_of::<AccessListItem>()
}
}
impl From<reth_rpc_types::AccessList> for AccessList {
#[inline]
fn from(value: reth_rpc_types::AccessList) -> Self {
let converted_list = value
.0
.into_iter()
.map(|item| AccessListItem { address: item.address, storage_keys: item.storage_keys })
.collect();
AccessList(converted_list)
}
}
impl From<AccessList> for reth_rpc_types::AccessList {
#[inline]
fn from(value: AccessList) -> Self {
let list = value
.0
.into_iter()
.map(|item| reth_rpc_types::AccessListItem {
address: item.address,
storage_keys: item.storage_keys,
})
.collect();
reth_rpc_types::AccessList(list)
}
}