Struct ethcore::block::OpenBlock
[−]
[src]
pub struct OpenBlock<'x> { /* fields omitted */ }
Block that is ready for transactions to be added.
It's a bit like a Vecstate()
. We also archive execution receipts in preparation for later block creation.
Methods
impl<'x> OpenBlock<'x>
[src]
fn new(engine: &'x Engine,
factories: Factories,
tracing: bool,
db: StateDB,
parent: &Header,
last_hashes: Arc<LastHashes>,
author: Address,
gas_range_target: (U256, U256),
extra_data: Bytes)
-> Result<Self, Error>
factories: Factories,
tracing: bool,
db: StateDB,
parent: &Header,
last_hashes: Arc<LastHashes>,
author: Address,
gas_range_target: (U256, U256),
extra_data: Bytes)
-> Result<Self, Error>
Create a new OpenBlock
ready for transaction pushing.
Alter the author for the block.
fn set_timestamp(&mut self, timestamp: u64)
Alter the timestamp of the block.
fn set_difficulty(&mut self, a: U256)
Alter the difficulty for the block.
fn set_gas_limit(&mut self, a: U256)
Alter the gas limit for the block.
fn set_gas_used(&mut self, a: U256)
Alter the gas limit for the block.
fn set_uncles_hash(&mut self, h: H256)
Alter the uncles hash the block.
fn set_transactions_root(&mut self, h: H256)
Alter transactions root for the block.
fn set_receipts_root(&mut self, h: H256)
Alter the receipts root for the block.
fn set_extra_data(&mut self, extra_data: Bytes) -> Result<(), BlockError>
Alter the extra_data for the block.
fn push_uncle(&mut self, valid_uncle_header: Header) -> Result<(), BlockError>
Add an uncle to the block, if possible.
NOTE Will check chain constraints and the uncle number but will NOT check that the header itself is actually valid.
fn env_info(&self) -> EnvInfo
Get the environment info concerning this block.
fn push_transaction(&mut self,
t: SignedTransaction,
h: Option<H256>)
-> Result<&Receipt, Error>
t: SignedTransaction,
h: Option<H256>)
-> Result<&Receipt, Error>
Push a transaction into the block.
If valid, it will be executed, and archived together with the receipt.
fn close(self) -> ClosedBlock
Turn this into a ClosedBlock
.
fn close_and_lock(self) -> LockedBlock
Turn this into a LockedBlock
.
Trait Implementations
impl<'x> IsBlock for OpenBlock<'x>
[src]
fn block(&self) -> &ExecutedBlock
Get the ExecutedBlock
associated with this object.
fn to_base(&self) -> Block
Get the base Block
object associated with this.
fn header(&self) -> &Header
Get the header associated with this object's block.
fn state(&self) -> &State
Get the final state associated with this object's block.
fn transactions(&self) -> &[SignedTransaction]
Get all information on transactions in this block.
fn receipts(&self) -> &[Receipt]
Get all information on receipts in this block.
fn traces(&self) -> &Option<Vec<Vec<FlatTrace>>>
Get all information concerning transaction tracing in this block.
fn uncles(&self) -> &[Header]
Get all uncles in this block.