mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: use rpc types Accesslist in inspector (#5549)
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user