Skip to content

Commit

Permalink
Stabilize transactionWatch_unstable JSON-RPC functions (#1771)
Browse files Browse the repository at this point in the history
* Stabilize `transactionWatch_unstable` JSON-RPC functions

* PR link
  • Loading branch information
tomaka authored Apr 18, 2024
1 parent fd7245d commit 6d6922b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 51 deletions.
6 changes: 3 additions & 3 deletions lib/src/json_rpc/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ define_methods! {
transaction_v1_broadcast(transaction: HexString) -> Cow<'a, str>,
transaction_v1_stop(#[rename = "operationId"] operation_id: Cow<'a, str>) -> (),

transactionWatch_unstable_submitAndWatch(transaction: HexString) -> Cow<'a, str>,
transactionWatch_unstable_unwatch(subscription: Cow<'a, str>) -> (),
transactionWatch_v1_submitAndWatch(transaction: HexString) -> Cow<'a, str>,
transactionWatch_v1_unwatch(subscription: Cow<'a, str>) -> (),

// These functions are a custom addition in smoldot. As of the writing of this comment, there
// is no plan to standardize them. See <https://github.com/paritytech/smoldot/issues/2245> and
Expand All @@ -524,7 +524,7 @@ define_methods! {

// The functions below are experimental and are defined in the document https://github.com/paritytech/json-rpc-interface-spec/
chainHead_v1_followEvent(subscription: Cow<'a, str>, result: FollowEvent<'a>) -> (),
transactionWatch_unstable_watchEvent(subscription: Cow<'a, str>, result: TransactionWatchEvent<'a>) -> (),
transactionWatch_v1_watchEvent(subscription: Cow<'a, str>, result: TransactionWatchEvent<'a>) -> (),

// This function is a custom addition in smoldot. As of the writing of this comment, there is
// no plan to standardize it. See https://github.com/paritytech/smoldot/issues/2245.
Expand Down
14 changes: 7 additions & 7 deletions lib/src/json_rpc/service/client_main_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ impl ClientMainTask {
| methods::MethodCall::state_subscribeRuntimeVersion { .. }
| methods::MethodCall::state_subscribeStorage { .. }
| methods::MethodCall::transaction_v1_broadcast { .. }
| methods::MethodCall::transactionWatch_unstable_submitAndWatch { .. }
| methods::MethodCall::transactionWatch_v1_submitAndWatch { .. }
| methods::MethodCall::sudo_network_unstable_watch { .. }
| methods::MethodCall::chainHead_v1_follow { .. } => {
// Subscription starting requests.
Expand Down Expand Up @@ -541,7 +541,7 @@ impl ClientMainTask {
| methods::MethodCall::transaction_v1_stop {
operation_id: subscription,
}
| methods::MethodCall::transactionWatch_unstable_unwatch { subscription, .. }
| methods::MethodCall::transactionWatch_v1_unwatch { subscription, .. }
| methods::MethodCall::sudo_network_unstable_unwatch { subscription, .. }
| methods::MethodCall::chainHead_v1_unfollow {
follow_subscription: subscription,
Expand All @@ -567,9 +567,9 @@ impl ClientMainTask {
methods::MethodCall::transaction_v1_stop { .. } => {
methods::Response::transaction_v1_stop(())
}
methods::MethodCall::transactionWatch_unstable_unwatch {
..
} => methods::Response::transactionWatch_unstable_unwatch(()),
methods::MethodCall::transactionWatch_v1_unwatch { .. } => {
methods::Response::transactionWatch_v1_unwatch(())
}
methods::MethodCall::sudo_network_unstable_unwatch {
..
} => methods::Response::sudo_network_unstable_unwatch(()),
Expand Down Expand Up @@ -1160,8 +1160,8 @@ impl SubscriptionStartProcess {
methods::MethodCall::state_subscribeStorage { .. } => {
methods::Response::state_subscribeStorage(Cow::Borrowed(&self.subscription_id))
}
methods::MethodCall::transactionWatch_unstable_submitAndWatch { .. } => {
methods::Response::transactionWatch_unstable_submitAndWatch(Cow::Borrowed(
methods::MethodCall::transactionWatch_v1_submitAndWatch { .. } => {
methods::Response::transactionWatch_v1_submitAndWatch(Cow::Borrowed(
&self.subscription_id,
))
}
Expand Down
Loading

0 comments on commit 6d6922b

Please sign in to comment.