Add a method to fetch current finalized head hash (#57)

* chore: Update to latest substrate master renames

* feat: Introduce Client::finalized_head
This commit is contained in:
Maciej Hirsz
2019-12-19 17:58:08 +01:00
committed by Andrew Jones
parent a9df35c570
commit 923013628b
2 changed files with 14 additions and 1 deletions
+6
View File
@@ -207,6 +207,12 @@ impl<T: System + Balances + 'static, S: 'static> Client<T, S> {
.and_then(|rpc| rpc.block_hash(hash.map(|h| h)))
}
/// Get a block hash of the latest finalized block
pub fn finalized_head(&self) -> impl Future<Item = T::Hash, Error = Error> {
self.connect()
.and_then(|rpc| rpc.finalized_head())
}
/// Get a block
pub fn block<H>(
&self,