Skip to content
Snippets Groups Projects
Unverified Commit 88a2f360 authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

chainHead: Stabilize chainHead to version 1 (#4168)


This PR stabilizes the chainHead API to version 1.

Needs:
- https://github.com/paritytech/polkadot-sdk/pull/3667

cc @paritytech/subxt-team

---------

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent c891fdab
Branches
No related merge requests found
Pipeline #467016 failed with stages
in 1 hour, 10 minutes, and 59 seconds
title: Stabilize chianHead RPC class to version 1
doc:
- audience: Node Dev
description: |
The chainHead RPC API is stabilized to version 1.
crates: [ ]
...@@ -37,15 +37,15 @@ pub trait ChainHeadApi<Hash> { ...@@ -37,15 +37,15 @@ pub trait ChainHeadApi<Hash> {
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[subscription( #[subscription(
name = "chainHead_unstable_follow" => "chainHead_unstable_followEvent", name = "chainHead_v1_follow" => "chainHead_v1_followEvent",
unsubscribe = "chainHead_unstable_unfollow", unsubscribe = "chainHead_v1_unfollow",
item = FollowEvent<Hash>, item = FollowEvent<Hash>,
)] )]
fn chain_head_unstable_follow(&self, with_runtime: bool); fn chain_head_unstable_follow(&self, with_runtime: bool);
/// Retrieves the body (list of transactions) of a pinned block. /// Retrieves the body (list of transactions) of a pinned block.
/// ///
/// This method should be seen as a complement to `chainHead_unstable_follow`, /// This method should be seen as a complement to `chainHead_v1_follow`,
/// allowing the JSON-RPC client to retrieve more information about a block /// allowing the JSON-RPC client to retrieve more information about a block
/// that has been reported. /// that has been reported.
/// ///
...@@ -54,7 +54,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -54,7 +54,7 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_body", raw_method)] #[method(name = "chainHead_v1_body", raw_method)]
async fn chain_head_unstable_body( async fn chain_head_unstable_body(
&self, &self,
follow_subscription: String, follow_subscription: String,
...@@ -63,7 +63,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -63,7 +63,7 @@ pub trait ChainHeadApi<Hash> {
/// Retrieves the header of a pinned block. /// Retrieves the header of a pinned block.
/// ///
/// This method should be seen as a complement to `chainHead_unstable_follow`, /// This method should be seen as a complement to `chainHead_v1_follow`,
/// allowing the JSON-RPC client to retrieve more information about a block /// allowing the JSON-RPC client to retrieve more information about a block
/// that has been reported. /// that has been reported.
/// ///
...@@ -73,7 +73,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -73,7 +73,7 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_header", raw_method)] #[method(name = "chainHead_v1_header", raw_method)]
async fn chain_head_unstable_header( async fn chain_head_unstable_header(
&self, &self,
follow_subscription: String, follow_subscription: String,
...@@ -85,7 +85,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -85,7 +85,7 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_storage", raw_method)] #[method(name = "chainHead_v1_storage", raw_method)]
async fn chain_head_unstable_storage( async fn chain_head_unstable_storage(
&self, &self,
follow_subscription: String, follow_subscription: String,
...@@ -99,7 +99,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -99,7 +99,7 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_call", raw_method)] #[method(name = "chainHead_v1_call", raw_method)]
async fn chain_head_unstable_call( async fn chain_head_unstable_call(
&self, &self,
follow_subscription: String, follow_subscription: String,
...@@ -118,7 +118,7 @@ pub trait ChainHeadApi<Hash> { ...@@ -118,7 +118,7 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_unpin", raw_method)] #[method(name = "chainHead_v1_unpin", raw_method)]
async fn chain_head_unstable_unpin( async fn chain_head_unstable_unpin(
&self, &self,
follow_subscription: String, follow_subscription: String,
...@@ -131,21 +131,21 @@ pub trait ChainHeadApi<Hash> { ...@@ -131,21 +131,21 @@ pub trait ChainHeadApi<Hash> {
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_continue", raw_method)] #[method(name = "chainHead_v1_continue", raw_method)]
async fn chain_head_unstable_continue( async fn chain_head_unstable_continue(
&self, &self,
follow_subscription: String, follow_subscription: String,
operation_id: String, operation_id: String,
) -> Result<(), Error>; ) -> Result<(), Error>;
/// Stops an operation started with chainHead_unstable_body, chainHead_unstable_call, or /// Stops an operation started with chainHead_v1_body, chainHead_v1_call, or
/// chainHead_unstable_storage. If the operation was still in progress, this interrupts it. If /// chainHead_v1_storage. If the operation was still in progress, this interrupts it. If
/// the operation was already finished, this call has no effect. /// the operation was already finished, this call has no effect.
/// ///
/// # Unstable /// # Unstable
/// ///
/// This method is unstable and subject to change in the future. /// This method is unstable and subject to change in the future.
#[method(name = "chainHead_unstable_stopOperation", raw_method)] #[method(name = "chainHead_v1_stopOperation", raw_method)]
async fn chain_head_unstable_stop_operation( async fn chain_head_unstable_stop_operation(
&self, &self,
follow_subscription: String, follow_subscription: String,
......
...@@ -186,7 +186,7 @@ impl OperationState { ...@@ -186,7 +186,7 @@ impl OperationState {
/// Stops the operation if `waitingForContinue` event was emitted for the associated /// Stops the operation if `waitingForContinue` event was emitted for the associated
/// operation ID. /// operation ID.
/// ///
/// Returns nothing in accordance with `chainHead_unstable_stopOperation`. /// Returns nothing in accordance with `chainHead_v1_stopOperation`.
pub fn stop_operation(&self) { pub fn stop_operation(&self) {
// `waitingForContinue` not generated. // `waitingForContinue` not generated.
if !self.shared_state.requested_continue.load(std::sync::atomic::Ordering::Acquire) { if !self.shared_state.requested_continue.load(std::sync::atomic::Ordering::Acquire) {
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment