Refactor to use only chain info (#4516)

This commit is contained in:
Nikolay Volf
2020-01-02 14:46:07 +03:00
committed by Bastian Köcher
parent 8ecc450fd9
commit 6d06a19f41
30 changed files with 178 additions and 175 deletions
+3 -3
View File
@@ -198,7 +198,7 @@ impl<
}
if link.imported_blocks >= count {
info!("Imported {} blocks. Best: #{}", read_block_count, client.info().chain.best_number);
info!("Imported {} blocks. Best: #{}", read_block_count, client.chain_info().best_number);
return std::task::Poll::Ready(Ok(()));
} else {
@@ -222,7 +222,7 @@ impl<
let last = match to {
Some(v) if v.is_zero() => One::one(),
Some(v) => v,
None => client.info().chain.best_number,
None => client.chain_info().best_number,
};
let mut wrote_header = false;
@@ -283,7 +283,7 @@ impl<
blocks: NumberFor<TBl>
) -> Result<(), Error> {
let reverted = self.client.revert(blocks)?;
let info = self.client.info().chain;
let info = self.client.chain_info();
if reverted.is_zero() {
info!("There aren't any non-finalized blocks to revert.");