Skip to content
Snippets Groups Projects
Unverified Commit 923f27cc authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

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: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent 817870e3
No related merge requests found
Pipeline #456596 failed with stages
in 55 minutes and 29 seconds
......@@ -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.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment