pub struct L2BlockBody {
pub data: Vec<u8>,
pub emissions: Vec<Emission>,
}Expand description
Body of an L2 block: application data bytes and reward emissions.
Fields§
§data: Vec<u8>Application-specific data bytes. Serialized as 0x-prefixed hex string.
emissions: Vec<Emission>Reward distribution records.
Implementations§
Source§impl L2BlockBody
impl L2BlockBody
Sourcepub fn calculate_data_root(&self) -> Hash32
pub fn calculate_data_root(&self) -> Hash32
Computes the DATA_ROOT as the Merkle root of COMPUTE_DATA_HASH(byte)
for each byte in self.data, sorted by hash ascending for determinism.
Sourcepub fn calculate_emissions_root(&self) -> Hash32
pub fn calculate_emissions_root(&self) -> Hash32
Computes the EMISSIONS_ROOT as the Merkle root of each emission’s
per-item hash, sorted by hash ascending for determinism.
Sourcepub fn calculate_root(&self) -> Hash32
pub fn calculate_root(&self) -> Hash32
Computes the overall BODY_ROOT from the two subroots.
Trait Implementations§
Source§impl Clone for L2BlockBody
impl Clone for L2BlockBody
Source§fn clone(&self) -> L2BlockBody
fn clone(&self) -> L2BlockBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for L2BlockBody
impl Debug for L2BlockBody
Source§impl<'de> Deserialize<'de> for L2BlockBody
impl<'de> Deserialize<'de> for L2BlockBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for L2BlockBody
impl PartialEq for L2BlockBody
Source§impl Serialize for L2BlockBody
impl Serialize for L2BlockBody
impl Eq for L2BlockBody
impl StructuralPartialEq for L2BlockBody
Auto Trait Implementations§
impl Freeze for L2BlockBody
impl RefUnwindSafe for L2BlockBody
impl Send for L2BlockBody
impl Sync for L2BlockBody
impl Unpin for L2BlockBody
impl UnwindSafe for L2BlockBody
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more