pub struct BlockHeader {
pub pow_hash: Option<H256>,
pub approximated_rlp_size: usize,
/* private fields */
}
Expand description
A block header.
Fields§
§pow_hash: Option<H256>
POW quality of the block
approximated_rlp_size: usize
Approximated rlp size of the block header
Implementations§
Source§impl BlockHeader
impl BlockHeader
Sourcepub fn approximated_rlp_size(&self) -> usize
pub fn approximated_rlp_size(&self) -> usize
Approximated rlp size of the block header.
Sourcepub fn parent_hash(&self) -> &H256
pub fn parent_hash(&self) -> &H256
Get the parent_hash field of the header.
Get the author field of the header.
Sourcepub fn transactions_root(&self) -> &H256
pub fn transactions_root(&self) -> &H256
Get the transactions root field of the header.
Sourcepub fn deferred_state_root(&self) -> &H256
pub fn deferred_state_root(&self) -> &H256
Get the deferred state root field of the header.
Sourcepub fn deferred_receipts_root(&self) -> &H256
pub fn deferred_receipts_root(&self) -> &H256
Get the deferred block receipts root field of the header.
Sourcepub fn deferred_logs_bloom_hash(&self) -> &H256
pub fn deferred_logs_bloom_hash(&self) -> &H256
Get the deferred block logs bloom hash field of the header.
Sourcepub fn difficulty(&self) -> &U256
pub fn difficulty(&self) -> &U256
Get the difficulty field of the header.
pub fn core_space_gas_limit(&self) -> U256
pub fn espace_gas_limit(&self, can_pack: bool) -> U256
Sourcepub fn referee_hashes(&self) -> &Vec<H256>
pub fn referee_hashes(&self) -> &Vec<H256>
Get the referee hashes field of the header.
Sourcepub fn pos_reference(&self) -> &Option<PosBlockId>
pub fn pos_reference(&self) -> &Option<PosBlockId>
Get the PoS reference.
pub fn base_price(&self) -> Option<SpaceMap<U256>>
pub fn space_base_price(&self, space: Space) -> Option<U256>
Sourcepub fn set_timestamp(&mut self, timestamp: u64)
pub fn set_timestamp(&mut self, timestamp: u64)
Set the timestamp filed of the header.
Sourcepub fn set_custom(&mut self, custom: Vec<Bytes>)
pub fn set_custom(&mut self, custom: Vec<Bytes>)
Set the custom filed of the header.
Sourcepub fn compute_hash(&mut self) -> H256
pub fn compute_hash(&mut self) -> H256
Compute the hash of the block.
Sourcepub fn problem_hash(&self) -> H256
pub fn problem_hash(&self) -> H256
Get the hash of PoW problem.
Sourcepub fn rlp_without_nonce(&self) -> Bytes
pub fn rlp_without_nonce(&self) -> Bytes
Get the RLP representation of this header(except nonce).
Sourcepub fn stream_rlp_with_pow_hash(&self, stream: &mut RlpStream)
pub fn stream_rlp_with_pow_hash(&self, stream: &mut RlpStream)
Place this header and its pow_hash
into an RLP stream stream
.
pub fn decode_with_pow_hash(bytes: &[u8]) -> Result<Self, DecoderError>
pub fn size(&self) -> usize
Trait Implementations§
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more