mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 23:08:03 +00:00
rpc: Subscribe to chainHead_unstable_body
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -624,6 +624,24 @@ impl<T: Config> Rpc<T> {
|
||||
Ok(subscription)
|
||||
}
|
||||
|
||||
/// Subscribe to the chain head body.
|
||||
pub async fn subscribe_chainhead_body(
|
||||
&self,
|
||||
hash: T::Hash,
|
||||
subscription_id: String,
|
||||
) -> Result<Subscription<FollowEvent<T::Hash>>, Error> {
|
||||
let subscription = self
|
||||
.client
|
||||
.subscribe(
|
||||
"chainHead_unstable_body",
|
||||
rpc_params![subscription_id, hash],
|
||||
"chainHead_unstable_stopBody",
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(subscription)
|
||||
}
|
||||
|
||||
/// Subscribe to finalized block headers.
|
||||
///
|
||||
/// Note: this may not produce _every_ block in the finalized chain;
|
||||
|
||||
Reference in New Issue
Block a user