companion for #8783 - jsonrpsee (#4344)

* add jsonrpsee glue code

* diener --substrate dp-jsonrpsee-integration-2

* cargo fmt

* update substrate

* fix build

* update substrate

* fix tests

* update substrate

* update substrate

* revert Cargo.toml

* revert changes in Cargo.toml

* jsonrpsee v0.11

* fix staking miner

* chore: update jsonrpsee v0.12

* update companion

* update companion

* fix changes in substrate

* revert requires_full_sync removal

* fix: read WS address from polkadot output

* fit nits

* fix more nits

* update lockfile for {"substrate"}

* cargo fmt

Co-authored-by: parity-processbot <>
This commit is contained in:
Niklas Adolfsson
2022-05-10 12:13:38 +02:00
committed by GitHub
parent 2a89e5612b
commit 804d0f38a5
20 changed files with 496 additions and 750 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ use std::collections::HashMap;
const DEFAULT_PROMETHEUS_PORT: u16 = 9616;
#[substrate_test_utils::test]
#[substrate_test_utils::test(flavor = "multi_thread")]
async fn runtime_can_publish_metrics() {
let mut alice_config =
node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true);
+1 -1
View File
@@ -21,4 +21,4 @@ rand = "0.8"
derive_more = "0.99"
[dev-dependencies]
rand_chacha = "0.3.1"
rand_chacha = "0.3.1"
+1 -1
View File
@@ -199,4 +199,4 @@ runtime-metrics = [
"polkadot-runtime-parachains/runtime-metrics"
]
staging-client = ["polkadot-node-core-provisioner/staging-client"]
staging-client = ["polkadot-node-core-provisioner/staging-client"]
+5 -2
View File
@@ -444,7 +444,10 @@ fn new_partial<RuntimeApi, ExecutorDispatch, ChainSelection>(
sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
(
impl service::RpcExtensionBuilder,
impl Fn(
polkadot_rpc::DenyUnsafe,
polkadot_rpc::SubscriptionTaskExecutor,
) -> Result<polkadot_rpc::RpcExtension, SubstrateServiceError>,
(
babe::BabeBlockImport<
Block,
@@ -938,7 +941,7 @@ where
client: client.clone(),
keystore: keystore_container.sync_keystore(),
network: network.clone(),
rpc_extensions_builder: Box::new(rpc_extensions_builder),
rpc_builder: Box::new(rpc_extensions_builder),
transaction_pool: transaction_pool.clone(),
task_manager: &mut task_manager,
system_rpc_tx,
+4
View File
@@ -190,9 +190,13 @@ pub fn node_config(
rpc_ws: None,
rpc_ipc: None,
rpc_max_payload: None,
rpc_max_request_size: None,
rpc_max_response_size: None,
rpc_ws_max_connections: None,
rpc_cors: None,
rpc_methods: Default::default(),
rpc_id_provider: None,
rpc_max_subs_per_conn: None,
ws_max_out_buffer_capacity: None,
prometheus_config: None,
telemetry_endpoints: None,
@@ -18,7 +18,7 @@ use futures::{future, pin_mut, select, FutureExt};
use polkadot_test_service::*;
use sp_keyring::Sr25519Keyring;
#[substrate_test_utils::test]
#[substrate_test_utils::test(flavor = "multi_thread")]
async fn ensure_test_service_build_blocks() {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(false);
@@ -17,7 +17,7 @@
use polkadot_test_service::*;
use sp_keyring::Sr25519Keyring::{Alice, Bob, Charlie};
#[substrate_test_utils::test]
#[substrate_test_utils::test(flavor = "multi_thread")]
async fn call_function_actually_work() {
let alice_config =
node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true);
@@ -30,7 +30,7 @@ async fn call_function_actually_work() {
});
let output = alice.send_extrinsic(function, Bob).await.unwrap();
let res = output.result.expect("return value expected");
let res = output.result;
let json = serde_json::from_str::<serde_json::Value>(res.as_str()).expect("valid JSON");
let object = json.as_object().expect("JSON is an object");
assert!(object.contains_key("jsonrpc"), "key jsonrpc exists");