txWatch: Stabilize txWatch to version 1 (#4171)

This PR stabilizes the txBroadcast API to version 1.

Needs from spec:
- https://github.com/paritytech/json-rpc-interface-spec/pull/153 
- https://github.com/paritytech/json-rpc-interface-spec/pull/154


cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-04-19 12:48:44 +03:00
committed by GitHub
parent 148d942ec0
commit eba3deca3e
3 changed files with 13 additions and 5 deletions
+8
View File
@@ -0,0 +1,8 @@
title: Stabilize transactionWatch RPC class to version 1
doc:
- audience: Node Dev
description: |
The transactionWatch RPC API is stabilized to version 1.
crates: [ ]
@@ -33,8 +33,8 @@ pub trait TransactionApi<Hash: Clone> {
///
/// This method is unstable and subject to change in the future.
#[subscription(
name = "transactionWatch_unstable_submitAndWatch" => "transactionWatch_unstable_watchEvent",
unsubscribe = "transactionWatch_unstable_unwatch",
name = "transactionWatch_v1_submitAndWatch" => "transactionWatch_v1_watchEvent",
unsubscribe = "transactionWatch_v1_unwatch",
item = TransactionEvent<Hash>,
)]
fn submit_and_watch(&self, bytes: Bytes);
@@ -38,7 +38,7 @@ async fn tx_invalid_bytes() {
// This should not rely on the tx pool state.
let mut sub = tx_api
.subscribe_unbounded("transactionWatch_unstable_submitAndWatch", rpc_params![&"0xdeadbeef"])
.subscribe_unbounded("transactionWatch_v1_submitAndWatch", rpc_params![&"0xdeadbeef"])
.await
.unwrap();
@@ -56,7 +56,7 @@ async fn tx_in_finalized() {
let xt = hex_string(&uxt.encode());
let mut sub = tx_api
.subscribe_unbounded("transactionWatch_unstable_submitAndWatch", rpc_params![&xt])
.subscribe_unbounded("transactionWatch_v1_submitAndWatch", rpc_params![&xt])
.await
.unwrap();
@@ -95,7 +95,7 @@ async fn tx_with_pruned_best_block() {
let xt = hex_string(&uxt.encode());
let mut sub = tx_api
.subscribe_unbounded("transactionWatch_unstable_submitAndWatch", rpc_params![&xt])
.subscribe_unbounded("transactionWatch_v1_submitAndWatch", rpc_params![&xt])
.await
.unwrap();