mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-07 15:27:21 +00:00
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:
committed by
Andrew Jones
parent
a9df35c570
commit
923013628b
+8
-1
@@ -168,6 +168,13 @@ impl<T: System> Rpc<T> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Get a block hash of the latest finalized block
|
||||
pub fn finalized_head(&self) -> impl Future<Item = T::Hash, Error = Error> {
|
||||
self.chain
|
||||
.finalized_head()
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Get a Block
|
||||
pub fn block(
|
||||
&self,
|
||||
@@ -286,7 +293,7 @@ impl<T: System + Balances + 'static> Rpc<T> {
|
||||
TransactionStatus::Future
|
||||
| TransactionStatus::Ready
|
||||
| TransactionStatus::Broadcast(_) => None,
|
||||
TransactionStatus::Finalized(block_hash) => {
|
||||
TransactionStatus::InBlock(block_hash) => {
|
||||
Some(Ok(block_hash))
|
||||
}
|
||||
TransactionStatus::Usurped(_) => {
|
||||
|
||||
Reference in New Issue
Block a user