Stabilize transactionBroadcast methods (#1540)

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
Alexandru Vasile
2024-04-20 14:58:58 +03:00
committed by GitHub
parent 240080a67e
commit c57df0845c
2 changed files with 13 additions and 16 deletions
+6 -6
View File
@@ -280,24 +280,24 @@ impl<T: Config> UnstableRpcMethods<T> {
}
/// Broadcast the transaction on the p2p network until the
/// [`Self::transaction_unstable_stop`] is called.
/// [`Self::transaction_v1_stop`] is called.
///
/// Returns an operation ID that can be used to stop the broadcasting process.
/// Returns `None` if the server cannot handle the request at the moment.
pub async fn transaction_unstable_broadcast(&self, tx: &[u8]) -> Result<Option<String>, Error> {
pub async fn transaction_v1_broadcast(&self, tx: &[u8]) -> Result<Option<String>, Error> {
self.client
.request("transaction_unstable_broadcast", rpc_params![to_hex(tx)])
.request("transaction_v1_broadcast", rpc_params![to_hex(tx)])
.await
}
/// Stop the broadcasting process of the transaction.
///
/// The operation ID is obtained from the [`Self::transaction_unstable_broadcast`] method.
/// The operation ID is obtained from the [`Self::transaction_v1_broadcast`] method.
///
/// Returns an error if the operation ID does not correspond to any active transaction for this connection.
pub async fn transaction_unstable_stop(&self, operation_id: &str) -> Result<(), Error> {
pub async fn transaction_v1_stop(&self, operation_id: &str) -> Result<(), Error> {
self.client
.request("transaction_unstable_stop", rpc_params![operation_id])
.request("transaction_v1_stop", rpc_params![operation_id])
.await
}
}