Struct primitives::block_header::BlockHeader
source · 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 moresource§impl Debug for BlockHeader
impl Debug for BlockHeader
source§impl Decodable for BlockHeader
impl Decodable for BlockHeader
source§impl DerefMut for BlockHeader
impl DerefMut for BlockHeader
source§fn deref_mut(&mut self) -> &mut BlockHeaderRlpPart
fn deref_mut(&mut self) -> &mut BlockHeaderRlpPart
source§impl Encodable for BlockHeader
impl Encodable for BlockHeader
source§impl MallocSizeOf for BlockHeader
impl MallocSizeOf for BlockHeader
source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
source§fn eq(&self, o: &BlockHeader) -> bool
fn eq(&self, o: &BlockHeader) -> bool
self
and other
values to be equal, and is used
by ==
.