feat: implement deref and derefMut for Requests (#8816)

This commit is contained in:
Thomas Coratger
2024-06-14 14:10:46 +02:00
committed by GitHub
parent 7d80164fad
commit 697cbd8b96

View File

@ -5,6 +5,7 @@ use alloy_eips::eip7685::{Decodable7685, Encodable7685};
use alloy_rlp::{Decodable, Encodable};
use reth_codecs::{main_codec, Compact};
use revm_primitives::Bytes;
use std::ops::{Deref, DerefMut};
/// A list of EIP-7685 requests.
#[main_codec]
@ -53,3 +54,17 @@ impl Decodable for Requests {
.map(Self)?)
}
}
impl Deref for Requests {
type Target = Vec<Request>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl DerefMut for Requests {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}