mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: update el requests for devnet 4 (#11865)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
//! Helper function for calculating Merkle proofs and hashes.
|
||||
|
||||
use crate::{
|
||||
Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Request, TransactionSigned, Withdrawal,
|
||||
Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, TransactionSigned, Withdrawal,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
use alloy_consensus::EMPTY_OMMER_ROOT_HASH;
|
||||
use alloy_eips::{eip2718::Encodable2718, eip7685::Encodable7685};
|
||||
use alloy_eips::eip2718::Encodable2718;
|
||||
use alloy_primitives::{keccak256, B256};
|
||||
use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder};
|
||||
|
||||
@ -29,13 +29,6 @@ pub fn calculate_receipt_root(receipts: &[ReceiptWithBloom]) -> B256 {
|
||||
ordered_trie_root_with_encoder(receipts, |r, buf| r.encode_inner(buf, false))
|
||||
}
|
||||
|
||||
/// Calculate [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) requests root.
|
||||
///
|
||||
/// NOTE: The requests are encoded as `id + request`
|
||||
pub fn calculate_requests_root(requests: &[Request]) -> B256 {
|
||||
ordered_trie_root_with_encoder(requests, |item, buf| item.encode_7685(buf))
|
||||
}
|
||||
|
||||
/// Calculates the receipt root for a header.
|
||||
pub fn calculate_receipt_root_ref(receipts: &[ReceiptWithBloomRef<'_>]) -> B256 {
|
||||
ordered_trie_root_with_encoder(receipts, |r, buf| r.encode_inner(buf, false))
|
||||
|
||||
Reference in New Issue
Block a user