Clean up justification (#1111)

* adding mac libraries and how to start testnet

* Clean up Justification struct, Issue #1033

* adding mac libraries and how to start testnet
This commit is contained in:
Shawn Tabrizi
2018-11-14 07:39:38 -05:00
committed by Robert Habermeier
parent 74e907f3cb
commit 7f8ee0f53b
7 changed files with 21 additions and 21 deletions
+5 -5
View File
@@ -962,8 +962,8 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
let ImportBlock {
origin,
header,
external_justification,
post_runtime_digests,
justification,
post_digests,
body,
finalized,
..
@@ -975,11 +975,11 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
blockchain::BlockStatus::Unknown => return Ok(ImportResult::UnknownParent),
}
let import_headers = if post_runtime_digests.is_empty() {
let import_headers = if post_digests.is_empty() {
PrePostHeader::Same(header)
} else {
let mut post_header = header.clone();
for item in post_runtime_digests {
for item in post_digests {
post_header.digest_mut().push(item);
}
PrePostHeader::Different(header, post_header)
@@ -994,7 +994,7 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
origin,
hash,
import_headers,
external_justification,
justification,
body,
new_authorities,
finalized,
+4 -4
View File
@@ -240,8 +240,8 @@ pub fn start_aura<B, C, E, SO, Error>(
let import_block = ImportBlock {
origin: BlockOrigin::Own,
header,
external_justification: Vec::new(),
post_runtime_digests: vec![item],
justification: Vec::new(),
post_digests: vec![item],
body: Some(body),
finalized: false,
auxiliary: Vec::new(),
@@ -365,8 +365,8 @@ impl<B: Block, C> Verifier<B> for AuraVerifier<C> where
let import_block = ImportBlock {
origin,
header: pre_header,
external_justification: Vec::new(),
post_runtime_digests: vec![item],
justification: Vec::new(),
post_digests: vec![item],
body,
finalized: false,
auxiliary: Vec::new(),
@@ -44,7 +44,7 @@ pub struct ImportBlock<Block: BlockT> {
///
/// Consensus engines which alter the header (by adding post-runtime digests)
/// should strip those off in the initial verification process and pass them
/// via the `post_runtime_digests` field. During block authorship, they should
/// via the `post_digests` field. During block authorship, they should
/// not be pushed to the header directly.
///
/// The reason for this distinction is so the header can be directly
@@ -52,10 +52,10 @@ pub struct ImportBlock<Block: BlockT> {
/// post-runtime digests are pushed back on after.
pub header: Block::Header,
/// Justification provided for this block from the outside:.
pub external_justification: Justification,
pub justification: Justification,
/// Digest items that have been added after the runtime for external
/// work, like a consensus signature.
pub post_runtime_digests: Vec<DigestItemFor<Block>>,
pub post_digests: Vec<DigestItemFor<Block>>,
/// Block's body
pub body: Option<Vec<Block::Extrinsic>>,
/// Is this block finalized already?
@@ -82,8 +82,8 @@ impl<Block: BlockT> ImportBlock<Block> {
(
self.origin,
self.header,
self.external_justification,
self.post_runtime_digests,
self.justification,
self.post_digests,
self.body,
self.finalized,
self.auxiliary,
+2 -2
View File
@@ -417,10 +417,10 @@ impl<B, P, I, InStream, OutSink> Future for BftFuture<B, P, I, InStream, OutSink
let import_block = ImportBlock {
origin: BlockOrigin::ConsensusBroadcast,
header: header,
external_justification: just.into(),
justification: just.into(),
body: Some(body),
finalized: true,
post_runtime_digests: Default::default(),
post_digests: Default::default(),
auxiliary: Default::default()
};
+2 -2
View File
@@ -569,8 +569,8 @@ impl<B: BlockT> Verifier<B> for PassThroughVerifier {
header,
body,
finalized: self.0,
external_justification: justification,
post_runtime_digests: vec![],
justification: justification,
post_digests: vec![],
auxiliary: Vec::new(),
}, None))
}
+2 -2
View File
@@ -47,8 +47,8 @@ impl<B, E, RA> TestClient for Client<B, E, runtime::Block, RA>
let import = ImportBlock {
origin,
header: block.header,
external_justification: vec![],
post_runtime_digests: vec![],
justification: vec![],
post_digests: vec![],
body: Some(block.extrinsics),
finalized: false,
auxiliary: Vec::new(),
+1 -1
View File
@@ -124,7 +124,7 @@ mod tests {
let block = proposer.propose().expect("Error making test block");
ImportBlock {
origin: BlockOrigin::File,
external_justification: Vec::new(),
justification: Vec::new(),
internal_justification: Vec::new(),
finalized: true,
body: Some(block.extrinsics),