Merge branch 'master' into author-relay-block

This commit is contained in:
Robert Habermeier
2018-01-31 18:10:53 +01:00
58 changed files with 3509 additions and 561 deletions
+10 -4
View File
@@ -20,24 +20,30 @@ use bytes;
use hash::H256;
use parachain;
/// Used to refer to a block number.
pub type Number = u64;
/// Hash used to refer to a block hash.
pub type HeaderHash = H256;
/// Hash used to refer to a transaction hash.
pub type TransactionHash = H256;
/// Execution log (event)
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
pub struct Log(#[serde(with="bytes")] pub Vec<u8>);
/// A relay chain block header.
///
/// https://github.com/w3f/polkadot-spec/blob/master/spec.md#header
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(deny_unknown_fields)]
pub struct Header {
/// Block parent's hash.
pub parent_hash: HeaderHash,
/// Block number.
pub number: u64,
pub number: Number,
/// State root after this transition.
pub state_root: H256,
/// Parachain activity bitfield
@@ -50,7 +56,7 @@ pub struct Header {
///
/// Included candidates should be sorted by parachain ID, and without duplicate
/// IDs.
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(deny_unknown_fields)]
pub struct Body {
+3 -3
View File
@@ -37,11 +37,11 @@ macro_rules! impl_serde {
}
}
impl_hash!(H160, 20);
construct_hash!(H160, 20);
impl_serde!(H160, 20);
impl_hash!(H256, 32);
construct_hash!(H256, 32);
impl_serde!(H256, 32);
impl_hash!(H512, 64);
construct_hash!(H512, 64);
impl_serde!(H512, 64);
#[cfg(test)]
+1 -1
View File
@@ -98,7 +98,7 @@ pub struct HeadData(#[serde(with="bytes")] pub Vec<u8>);
pub struct ValidationCode(#[serde(with="bytes")] pub Vec<u8>);
/// Activitiy bit field
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, Default, Serialize, Deserialize)]
pub struct Activity(#[serde(with="bytes")] pub Vec<u8>);
#[cfg(test)]