client sets aux in import pipeline

This commit is contained in:
Robert Habermeier
2018-10-17 13:34:59 -07:00
parent d346b330f9
commit 9630f34775
+5 -1
View File
@@ -503,6 +503,7 @@ impl<B, E, Block> Client<B, E, Block> where
body: Option<Vec<Block::Extrinsic>>,
authorities: Option<Vec<AuthorityId>>,
finalized: bool,
aux: Vec<(Vec<u8>, Option<Vec<u8>>)>,
) -> error::Result<ImportResult> {
let parent_hash = import_headers.post().parent_hash().clone();
match self.backend.blockchain().status(BlockId::Hash(hash))? {
@@ -593,6 +594,8 @@ impl<B, E, Block> Client<B, E, Block> where
if let Some(Some(changes_update)) = changes_update {
transaction.update_changes_trie(changes_update)?;
}
transaction.set_aux(aux)?;
self.backend.commit_operation(transaction)?;
if make_notifications {
@@ -916,7 +919,7 @@ impl<B, E, Block> consensus::BlockImport<Block> for Client<B, E, Block> where
post_runtime_digests,
body,
finalized,
..
auxiliary,
} = import_block;
let parent_hash = header.parent_hash().clone();
@@ -948,6 +951,7 @@ impl<B, E, Block> consensus::BlockImport<Block> for Client<B, E, Block> where
body,
new_authorities,
finalized,
auxiliary,
);
*self.importing_block.write() = None;