[−][src]Struct exonum::blockchain::Block
Exonum block header data structure.
A block is essentially a list of transactions, which is a result of the consensus algorithm (thus authenticated by the supermajority of validators) and is applied atomically to the blockchain state.
The header only contains the amount of transactions and the transactions root hash as well as other information, but not the transactions themselves.
Fields
proposer_id: ValidatorId
Identifier of the leader node which has proposed the block.
height: Height
Height of the block, which is also the number of this particular block in the blockchain.
tx_count: u32
Number of transactions in this block.
prev_hash: Hash
Hash link to the previous block in the blockchain.
tx_hash: Hash
Root hash of the Merkle tree of transactions in this block.
state_hash: Hash
Hash of the blockchain state after applying transactions in the block.
Methods
impl Block
[src]
pub fn new(
proposer_id: ValidatorId,
height: Height,
tx_count: u32,
prev_hash: Hash,
tx_hash: Hash,
state_hash: Hash
) -> Self
[src]
proposer_id: ValidatorId,
height: Height,
tx_count: u32,
prev_hash: Hash,
tx_hash: Hash,
state_hash: Hash
) -> Self
Create new Block
.
pub fn proposer_id(&self) -> ValidatorId
[src]
Identifier of the leader node which has proposed the block.
pub fn height(&self) -> Height
[src]
Height of the block, which is also the number of this particular block in the blockchain.
pub fn tx_count(&self) -> u32
[src]
Number of transactions in this block.
pub fn prev_hash(&self) -> &Hash
[src]
Hash link to the previous block in the blockchain.
pub fn tx_hash(&self) -> &Hash
[src]
Root hash of the Merkle tree of transactions in this block.
pub fn state_hash(&self) -> &Hash
[src]
Hash of the blockchain state after applying transactions in the block.
Trait Implementations
impl Clone for Block
[src]
impl Eq for Block
[src]
impl Ord for Block
[src]
fn cmp(&self, other: &Block) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Block> for Block
[src]
impl PartialOrd<Block> for Block
[src]
fn partial_cmp(&self, other: &Block) -> Option<Ordering>
[src]
fn lt(&self, other: &Block) -> bool
[src]
fn le(&self, other: &Block) -> bool
[src]
fn gt(&self, other: &Block) -> bool
[src]
fn ge(&self, other: &Block) -> bool
[src]
impl Debug for Block
[src]
impl StructuralPartialEq for Block
[src]
impl StructuralEq for Block
[src]
impl Serialize for Block
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Block
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl BinaryValue for Block
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl ObjectHash for Block
[src]
fn object_hash(&self) -> Hash
[src]
impl ProtobufConvert for Block
[src]
type ProtoStruct = Block
Type of the protobuf clone of Self
fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
[src]
fn to_pb(&self) -> Self::ProtoStruct
[src]
Auto Trait Implementations
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
impl RefUnwindSafe for Block
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Erased for T
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,