mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 04:45:42 +00:00
Stabilize transactionWatch methods (#1539)
* Stabilize transactionWatch Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Keep consistency in naming method class Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
@@ -477,7 +477,7 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for UnstableBackend<T> {
|
|||||||
// Then, submit the transaction.
|
// Then, submit the transaction.
|
||||||
let mut tx_progress = self
|
let mut tx_progress = self
|
||||||
.methods
|
.methods
|
||||||
.transaction_unstable_submit_and_watch(extrinsic)
|
.transactionwatch_v1_submit_and_watch(extrinsic)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mut seen_blocks = HashMap::new();
|
let mut seen_blocks = HashMap::new();
|
||||||
|
|||||||
@@ -263,16 +263,16 @@ impl<T: Config> UnstableRpcMethods<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Attempt to submit a transaction, returning events about its progress.
|
/// Attempt to submit a transaction, returning events about its progress.
|
||||||
pub async fn transaction_unstable_submit_and_watch(
|
pub async fn transactionwatch_v1_submit_and_watch(
|
||||||
&self,
|
&self,
|
||||||
tx: &[u8],
|
tx: &[u8],
|
||||||
) -> Result<TransactionSubscription<T::Hash>, Error> {
|
) -> Result<TransactionSubscription<T::Hash>, Error> {
|
||||||
let sub = self
|
let sub = self
|
||||||
.client
|
.client
|
||||||
.subscribe(
|
.subscribe(
|
||||||
"transactionWatch_unstable_submitAndWatch",
|
"transactionWatch_v1_submitAndWatch",
|
||||||
rpc_params![to_hex(tx)],
|
rpc_params![to_hex(tx)],
|
||||||
"transactionWatch_unstable_unwatch",
|
"transactionWatch_v1_unwatch",
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ async fn chainspec_v1_properties() {
|
|||||||
|
|
||||||
#[cfg(fullclient)]
|
#[cfg(fullclient)]
|
||||||
#[subxt_test]
|
#[subxt_test]
|
||||||
async fn transaction_unstable_submit_and_watch() {
|
async fn transactionwatch_v1_submit_and_watch() {
|
||||||
let ctx = test_context().await;
|
let ctx = test_context().await;
|
||||||
let rpc = ctx.unstable_rpc_methods().await;
|
let rpc = ctx.unstable_rpc_methods().await;
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ async fn transaction_unstable_submit_and_watch() {
|
|||||||
|
|
||||||
// Test submitting it:
|
// Test submitting it:
|
||||||
let mut sub = rpc
|
let mut sub = rpc
|
||||||
.transaction_unstable_submit_and_watch(&tx_bytes)
|
.transactionwatch_v1_submit_and_watch(&tx_bytes)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user