[][src]Struct exonum::blockchain::Block

pub struct Block {
    pub proposer_id: ValidatorId,
    pub height: Height,
    pub tx_count: u32,
    pub prev_hash: Hash,
    pub tx_hash: Hash,
    pub state_hash: Hash,
}

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]

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]

impl PartialEq<Block> for Block[src]

impl PartialOrd<Block> for Block[src]

impl Debug for Block[src]

impl StructuralPartialEq for Block[src]

impl StructuralEq for Block[src]

impl Serialize for Block[src]

impl<'de> Deserialize<'de> for Block[src]

impl BinaryValue for Block[src]

impl ObjectHash for Block[src]

impl ProtobufConvert for Block[src]

type ProtoStruct = Block

Type of the protobuf clone of Self

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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Erased for T

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]