mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 03:38:00 +00:00
rpc: Enable transaction_unstable_broadcast RPC V2 API (#3713)
This PR enables the `transaction_unstable_broadcast ` and `transaction_unstable_stop` RPC API. Since the API is unstable, we don't need to expose this in the release notes. After merging this, we could validate the API in subxt and stabilize it. Spec PR that stabilizes the API: https://github.com/paritytech/json-rpc-interface-spec/pull/139 cc @paritytech/subxt-team Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -64,7 +64,9 @@ use sc_rpc::{
|
||||
DenyUnsafe, SubscriptionTaskExecutor,
|
||||
};
|
||||
use sc_rpc_spec_v2::{
|
||||
archive::ArchiveApiServer, chain_head::ChainHeadApiServer, transaction::TransactionApiServer,
|
||||
archive::ArchiveApiServer,
|
||||
chain_head::ChainHeadApiServer,
|
||||
transaction::{TransactionApiServer, TransactionBroadcastApiServer},
|
||||
};
|
||||
use sc_telemetry::{telemetry, ConnectionMessage, Telemetry, TelemetryHandle, SUBSTRATE_INFO};
|
||||
use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool};
|
||||
@@ -653,6 +655,13 @@ where
|
||||
(chain, state, child_state)
|
||||
};
|
||||
|
||||
let transaction_broadcast_rpc_v2 = sc_rpc_spec_v2::transaction::TransactionBroadcast::new(
|
||||
client.clone(),
|
||||
transaction_pool.clone(),
|
||||
task_executor.clone(),
|
||||
)
|
||||
.into_rpc();
|
||||
|
||||
let transaction_v2 = sc_rpc_spec_v2::transaction::Transaction::new(
|
||||
client.clone(),
|
||||
transaction_pool.clone(),
|
||||
@@ -708,6 +717,9 @@ where
|
||||
|
||||
// Part of the RPC v2 spec.
|
||||
rpc_api.merge(transaction_v2).map_err(|e| Error::Application(e.into()))?;
|
||||
rpc_api
|
||||
.merge(transaction_broadcast_rpc_v2)
|
||||
.map_err(|e| Error::Application(e.into()))?;
|
||||
rpc_api.merge(chain_head_v2).map_err(|e| Error::Application(e.into()))?;
|
||||
|
||||
// Part of the old RPC spec.
|
||||
|
||||
Reference in New Issue
Block a user