mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-07 21:45:24 -05:00
* Scaffolding for reth test binary. wip for blockchain tests * wip models for chain json tests * reth binary and chain test * fmt,clippy * Update bin/reth/src/lib.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/lib.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/mod.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/mod.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/mod.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/models.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/models.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/mod.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Update bin/reth/src/test_eth_chain/runner.rs Co-authored-by: Bjerg <onbjerg@users.noreply.github.com> * Move JsonU256 to primitives * fmt * Use eyre * nits Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
46 lines
1.0 KiB
Rust
46 lines
1.0 KiB
Rust
use crate::{Header, HeaderLocked, Receipt, Transaction, TransactionSigned, H256};
|
|
use std::ops::Deref;
|
|
|
|
/// Ethereum full block.
|
|
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
|
pub struct Block {
|
|
/// Block header.
|
|
pub header: Header,
|
|
/// Transactions in this block.
|
|
pub body: Vec<Transaction>,
|
|
/// Block receipts.
|
|
pub receipts: Vec<Receipt>,
|
|
}
|
|
|
|
impl Deref for Block {
|
|
type Target = Header;
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.header
|
|
}
|
|
}
|
|
|
|
/// Sealed Ethereum full block.
|
|
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
|
pub struct BlockLocked {
|
|
/// Locked block header.
|
|
pub header: HeaderLocked,
|
|
/// Transactions with signatures.
|
|
pub body: Vec<TransactionSigned>,
|
|
/// Block receipts.
|
|
pub receipts: Vec<Receipt>,
|
|
}
|
|
|
|
impl BlockLocked {
|
|
/// Header hash.
|
|
pub fn hash(&self) -> H256 {
|
|
self.header.hash()
|
|
}
|
|
}
|
|
|
|
impl Deref for BlockLocked {
|
|
type Target = Header;
|
|
fn deref(&self) -> &Self::Target {
|
|
self.header.as_ref()
|
|
}
|
|
}
|