mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 08:41:07 +00:00
extract out all primitives
This commit is contained in:
@@ -16,9 +16,10 @@
|
||||
|
||||
//! Block and header type definitions.
|
||||
|
||||
use bytes;
|
||||
use bytes::{self, Vec};
|
||||
use hash::H256;
|
||||
use parachain;
|
||||
use transaction::UncheckedTransaction;
|
||||
|
||||
/// Used to refer to a block number.
|
||||
pub type Number = u64;
|
||||
@@ -33,6 +34,22 @@ pub type TransactionHash = H256;
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
||||
pub struct Log(#[serde(with="bytes")] pub Vec<u8>);
|
||||
|
||||
/// A Polkadot relay chain block.
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
||||
pub struct Block {
|
||||
/// The block header.
|
||||
pub header: Header,
|
||||
/// All relay-chain transactions.
|
||||
pub transactions: Vec<UncheckedTransaction>,
|
||||
}
|
||||
|
||||
/// The digest of a block, useful for light-clients.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct Digest {
|
||||
/// All logs that have happened in the block.
|
||||
pub logs: Vec<Log>,
|
||||
}
|
||||
|
||||
/// A relay chain block header.
|
||||
///
|
||||
/// https://github.com/w3f/polkadot-spec/blob/master/spec.md#header
|
||||
@@ -46,10 +63,12 @@ pub struct Header {
|
||||
pub number: Number,
|
||||
/// State root after this transition.
|
||||
pub state_root: H256,
|
||||
/// The root of the trie that represents this block's transactions, indexed by a 32-byte integer.
|
||||
pub transaction_root: H256,
|
||||
/// Parachain activity bitfield
|
||||
pub parachain_activity: parachain::Activity,
|
||||
/// Logs (generated by execution)
|
||||
pub logs: Vec<Log>,
|
||||
/// The digest of activity on the block.
|
||||
pub digest: Digest,
|
||||
}
|
||||
|
||||
/// A relay chain block body.
|
||||
|
||||
Reference in New Issue
Block a user