mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: update revm 19 alloy 09 (#13594)
This commit is contained in:
@ -19,7 +19,7 @@ use reth_codecs_derive::add_arbitrary_tests;
|
||||
#[cfg_attr(feature = "test-utils", allow(unreachable_pub), visibility::make(pub))]
|
||||
#[add_arbitrary_tests(crate, compact)]
|
||||
pub(crate) struct Authorization {
|
||||
chain_id: u64,
|
||||
chain_id: U256,
|
||||
address: Address,
|
||||
nonce: u64,
|
||||
}
|
||||
@ -80,7 +80,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_roundtrip_compact_authorization_list_item() {
|
||||
let authorization = AlloyAuthorization {
|
||||
chain_id: 1u64,
|
||||
chain_id: U256::from(1),
|
||||
address: address!("dac17f958d2ee523a2206206994597c13d831ec7"),
|
||||
nonce: 1,
|
||||
}
|
||||
|
||||
@ -58,7 +58,6 @@ pub(crate) struct Header {
|
||||
#[reth_codecs(crate = "crate")]
|
||||
pub(crate) struct HeaderExt {
|
||||
requests_hash: Option<B256>,
|
||||
target_blobs_per_block: Option<u64>,
|
||||
}
|
||||
|
||||
impl HeaderExt {
|
||||
@ -66,7 +65,7 @@ impl HeaderExt {
|
||||
///
|
||||
/// Required since [`Header`] uses `Option<HeaderExt>` as a field.
|
||||
const fn into_option(self) -> Option<Self> {
|
||||
if self.requests_hash.is_some() || self.target_blobs_per_block.is_some() {
|
||||
if self.requests_hash.is_some() {
|
||||
Some(self)
|
||||
} else {
|
||||
None
|
||||
@ -79,7 +78,7 @@ impl Compact for AlloyHeader {
|
||||
where
|
||||
B: bytes::BufMut + AsMut<[u8]>,
|
||||
{
|
||||
let extra_fields = HeaderExt { requests_hash: self.requests_hash, target_blobs_per_block: self.target_blobs_per_block };
|
||||
let extra_fields = HeaderExt { requests_hash: self.requests_hash };
|
||||
|
||||
let header = Header {
|
||||
parent_hash: self.parent_hash,
|
||||
@ -131,7 +130,6 @@ impl Compact for AlloyHeader {
|
||||
parent_beacon_block_root: header.parent_beacon_block_root,
|
||||
requests_hash: header.extra_fields.as_ref().and_then(|h| h.requests_hash),
|
||||
extra_data: header.extra_data,
|
||||
target_blobs_per_block: header.extra_fields.as_ref().and_then(|h| h.target_blobs_per_block),
|
||||
};
|
||||
(alloy_header, buf)
|
||||
}
|
||||
@ -190,7 +188,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_extra_fields() {
|
||||
let mut header = HOLESKY_BLOCK;
|
||||
header.extra_fields = Some(HeaderExt { requests_hash: Some(B256::random()), target_blobs_per_block: Some(3) });
|
||||
header.extra_fields = Some(HeaderExt { requests_hash: Some(B256::random())});
|
||||
|
||||
let mut encoded_header = vec![];
|
||||
let len = header.to_compact(&mut encoded_header);
|
||||
|
||||
Reference in New Issue
Block a user