mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
* update polkadot and substrate * add jsonrpsee glue code * fix tests * update substrate & polkadot * update substrate & polkadot * update Cargo.lock * revert Cargo.toml * revert changes in Cargo.toml * update companion * revert substrate change * add Cargo.lock * update substrate manually * update polkadot
This commit is contained in:
Generated
+509
-845
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ use cumulus_primitives_core::ParaId;
|
|||||||
use cumulus_test_service::{initial_head_data, run_relay_chain_validator_node, Keyring::*};
|
use cumulus_test_service::{initial_head_data, run_relay_chain_validator_node, Keyring::*};
|
||||||
use futures::join;
|
use futures::join;
|
||||||
|
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test(flavor = "multi_thread")]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
async fn sync_blocks_from_tip_without_being_connected_to_a_collator() {
|
async fn sync_blocks_from_tip_without_being_connected_to_a_collator() {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ use std::sync::Arc;
|
|||||||
/// If there is a block of the parachain included/backed by the relay chain that isn't circulated in
|
/// If there is a block of the parachain included/backed by the relay chain that isn't circulated in
|
||||||
/// the parachain network, we need to recover the PoV from the relay chain. Using this PoV we can
|
/// the parachain network, we need to recover the PoV from the relay chain. Using this PoV we can
|
||||||
/// recover the block, import it and share it with the other nodes of the parachain network.
|
/// recover the block, import it and share it with the other nodes of the parachain network.
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test(flavor = "multi_thread")]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
async fn pov_recovery() {
|
async fn pov_recovery() {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ parking_lot = "0.12.0"
|
|||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
async-trait = "0.1.53"
|
async-trait = "0.1.53"
|
||||||
thiserror = "1.0.31"
|
thiserror = "1.0.31"
|
||||||
jsonrpsee-core = "0.11.0"
|
jsonrpsee-core = "0.12.0"
|
||||||
parity-scale-codec = "3.1.2"
|
parity-scale-codec = "3.1.2"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ futures = "0.3.21"
|
|||||||
futures-timer = "3.0.2"
|
futures-timer = "3.0.2"
|
||||||
parity-scale-codec = "3.1.2"
|
parity-scale-codec = "3.1.2"
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
jsonrpsee = { version = "0.11.0", features = ["client"] }
|
jsonrpsee = { version = "0.12.0", features = ["client"] }
|
||||||
tracing = "0.1.34"
|
tracing = "0.1.34"
|
||||||
async-trait = "0.1.53"
|
async-trait = "0.1.53"
|
||||||
url = "2.2.2"
|
url = "2.2.2"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ log = "0.4.17"
|
|||||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||||
serde = { version = "1.0.137", features = ["derive"] }
|
serde = { version = "1.0.137", features = ["derive"] }
|
||||||
hex-literal = "0.3.4"
|
hex-literal = "0.3.4"
|
||||||
jsonrpc-core = "18.0.0"
|
jsonrpsee = { version = "0.12.0", features = ["server"] }
|
||||||
|
|
||||||
# Local
|
# Local
|
||||||
parachain-template-runtime = { path = "../runtime" }
|
parachain-template-runtime = { path = "../runtime" }
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use sp_block_builder::BlockBuilder;
|
|||||||
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
||||||
|
|
||||||
/// A type representing all RPC extensions.
|
/// A type representing all RPC extensions.
|
||||||
pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
|
pub type RpcExtension = jsonrpsee::RpcModule<()>;
|
||||||
|
|
||||||
/// Full client dependencies
|
/// Full client dependencies
|
||||||
pub struct FullDeps<C, P> {
|
pub struct FullDeps<C, P> {
|
||||||
@@ -30,7 +30,9 @@ pub struct FullDeps<C, P> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Instantiate all RPC extensions.
|
/// Instantiate all RPC extensions.
|
||||||
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> RpcExtension
|
pub fn create_full<C, P>(
|
||||||
|
deps: FullDeps<C, P>,
|
||||||
|
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
|
||||||
where
|
where
|
||||||
C: ProvideRuntimeApi<Block>
|
C: ProvideRuntimeApi<Block>
|
||||||
+ HeaderBackend<Block>
|
+ HeaderBackend<Block>
|
||||||
@@ -44,14 +46,13 @@ where
|
|||||||
C::Api: BlockBuilder<Block>,
|
C::Api: BlockBuilder<Block>,
|
||||||
P: TransactionPool + Sync + Send + 'static,
|
P: TransactionPool + Sync + Send + 'static,
|
||||||
{
|
{
|
||||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
|
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
|
||||||
use substrate_frame_rpc_system::{FullSystem, SystemApi};
|
use substrate_frame_rpc_system::{SystemApiServer, SystemRpc};
|
||||||
|
|
||||||
let mut io = jsonrpc_core::IoHandler::default();
|
let mut module = RpcExtension::new(());
|
||||||
let FullDeps { client, pool, deny_unsafe } = deps;
|
let FullDeps { client, pool, deny_unsafe } = deps;
|
||||||
|
|
||||||
io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)));
|
module.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
|
||||||
io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client)));
|
module.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
|
||||||
|
Ok(module)
|
||||||
io
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
// std
|
// std
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
|
|
||||||
|
// rpc
|
||||||
|
use jsonrpsee::RpcModule;
|
||||||
|
|
||||||
use cumulus_client_cli::CollatorOptions;
|
use cumulus_client_cli::CollatorOptions;
|
||||||
// Local Runtime Types
|
// Local Runtime Types
|
||||||
use parachain_template_runtime::{
|
use parachain_template_runtime::{
|
||||||
@@ -222,7 +225,7 @@ where
|
|||||||
Executor: sc_executor::NativeExecutionDispatch + 'static,
|
Executor: sc_executor::NativeExecutionDispatch + 'static,
|
||||||
RB: Fn(
|
RB: Fn(
|
||||||
Arc<TFullClient<Block, RuntimeApi, Executor>>,
|
Arc<TFullClient<Block, RuntimeApi, Executor>>,
|
||||||
) -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, sc_service::Error>
|
) -> Result<RpcModule<()>, sc_service::Error>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
BIQ: FnOnce(
|
BIQ: FnOnce(
|
||||||
@@ -301,7 +304,7 @@ where
|
|||||||
warp_sync: None,
|
warp_sync: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let rpc_extensions_builder = {
|
let rpc_builder = {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
let transaction_pool = transaction_pool.clone();
|
let transaction_pool = transaction_pool.clone();
|
||||||
|
|
||||||
@@ -312,12 +315,12 @@ where
|
|||||||
deny_unsafe,
|
deny_unsafe,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(crate::rpc::create_full(deps))
|
crate::rpc::create_full(deps).map_err(Into::into)
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
rpc_extensions_builder,
|
rpc_builder,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
@@ -461,7 +464,7 @@ pub async fn start_parachain_node(
|
|||||||
polkadot_config,
|
polkadot_config,
|
||||||
collator_options,
|
collator_options,
|
||||||
id,
|
id,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(RpcModule::new(())),
|
||||||
parachain_build_import_queue,
|
parachain_build_import_queue,
|
||||||
|client,
|
|client,
|
||||||
prometheus_registry,
|
prometheus_registry,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ statemint-runtime = { path = "statemint" }
|
|||||||
statemine-runtime = { path = "statemine" }
|
statemine-runtime = { path = "statemine" }
|
||||||
westmint-runtime = { path = "westmint" }
|
westmint-runtime = { path = "westmint" }
|
||||||
canvas-kusama-runtime = { path = "canvas-kusama" }
|
canvas-kusama-runtime = { path = "canvas-kusama" }
|
||||||
jsonrpc-core = "18.0.0"
|
jsonrpsee = { version = "0.12.0", features = ["server"] }
|
||||||
parachains-common = { path = "parachains-common" }
|
parachains-common = { path = "parachains-common" }
|
||||||
|
|
||||||
# Substrate
|
# Substrate
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use pallet_contracts_rpc::{Contracts, ContractsApi};
|
|
||||||
use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Index as Nonce};
|
use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Index as Nonce};
|
||||||
use sc_client_api::AuxStore;
|
use sc_client_api::AuxStore;
|
||||||
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
|
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
|
||||||
@@ -30,7 +29,7 @@ use sp_block_builder::BlockBuilder;
|
|||||||
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
||||||
|
|
||||||
/// A type representing all RPC extensions.
|
/// A type representing all RPC extensions.
|
||||||
pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
|
pub type RpcExtension = jsonrpsee::RpcModule<()>;
|
||||||
|
|
||||||
/// Full client dependencies
|
/// Full client dependencies
|
||||||
pub struct FullDeps<C, P> {
|
pub struct FullDeps<C, P> {
|
||||||
@@ -43,7 +42,9 @@ pub struct FullDeps<C, P> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Instantiate all RPC extensions.
|
/// Instantiate all RPC extensions.
|
||||||
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> RpcExtension
|
pub fn create_full<C, P>(
|
||||||
|
deps: FullDeps<C, P>,
|
||||||
|
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
|
||||||
where
|
where
|
||||||
C: ProvideRuntimeApi<Block>
|
C: ProvideRuntimeApi<Block>
|
||||||
+ HeaderBackend<Block>
|
+ HeaderBackend<Block>
|
||||||
@@ -57,20 +58,22 @@ where
|
|||||||
C::Api: BlockBuilder<Block>,
|
C::Api: BlockBuilder<Block>,
|
||||||
P: TransactionPool + Sync + Send + 'static,
|
P: TransactionPool + Sync + Send + 'static,
|
||||||
{
|
{
|
||||||
use frame_rpc_system::{FullSystem, SystemApi};
|
use frame_rpc_system::{SystemApiServer, SystemRpc};
|
||||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
|
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
|
||||||
|
|
||||||
let mut io = jsonrpc_core::IoHandler::default();
|
let mut module = RpcExtension::new(());
|
||||||
let FullDeps { client, pool, deny_unsafe } = deps;
|
let FullDeps { client, pool, deny_unsafe } = deps;
|
||||||
|
|
||||||
io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)));
|
module.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?;
|
||||||
io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())));
|
module.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
|
||||||
|
|
||||||
io
|
Ok(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Instantiate all RPCs we want at the canvas-kusama chain.
|
/// Instantiate all RPCs we want at the canvas-kusama chain.
|
||||||
pub fn create_canvas_kusama<C, P>(deps: FullDeps<C, P>) -> RpcExtension
|
pub fn create_canvas_kusama<C, P>(
|
||||||
|
deps: FullDeps<C, P>,
|
||||||
|
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
|
||||||
where
|
where
|
||||||
C: ProvideRuntimeApi<Block>
|
C: ProvideRuntimeApi<Block>
|
||||||
+ sc_client_api::BlockBackend<Block>
|
+ sc_client_api::BlockBackend<Block>
|
||||||
@@ -86,16 +89,18 @@ where
|
|||||||
C::Api: BlockBuilder<Block>,
|
C::Api: BlockBuilder<Block>,
|
||||||
P: TransactionPool + Sync + Send + 'static,
|
P: TransactionPool + Sync + Send + 'static,
|
||||||
{
|
{
|
||||||
use frame_rpc_system::{FullSystem, SystemApi};
|
use frame_rpc_system::{SystemApiServer, SystemRpc};
|
||||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
|
use pallet_contracts_rpc::{ContractsApiServer, ContractsRpc};
|
||||||
|
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
|
||||||
|
use sc_rpc::dev::{Dev, DevApiServer};
|
||||||
|
|
||||||
let mut io = jsonrpc_core::IoHandler::default();
|
let mut module = RpcExtension::new(());
|
||||||
let FullDeps { client, pool, deny_unsafe } = deps;
|
let FullDeps { client, pool, deny_unsafe } = deps;
|
||||||
|
|
||||||
io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)));
|
module.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?;
|
||||||
io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())));
|
module.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
|
||||||
io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));
|
module.merge(ContractsRpc::new(client.clone()).into_rpc())?;
|
||||||
io.extend_with(sc_rpc::dev::DevApi::to_delegate(sc_rpc::dev::Dev::new(client, deny_unsafe)));
|
module.merge(Dev::new(client, deny_unsafe).into_rpc())?;
|
||||||
|
|
||||||
io
|
Ok(module)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface;
|
|||||||
use polkadot_service::CollatorPair;
|
use polkadot_service::CollatorPair;
|
||||||
use sp_core::Pair;
|
use sp_core::Pair;
|
||||||
|
|
||||||
|
use jsonrpsee::RpcModule;
|
||||||
|
|
||||||
use crate::rpc;
|
use crate::rpc;
|
||||||
pub use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index as Nonce};
|
pub use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index as Nonce};
|
||||||
|
|
||||||
@@ -340,7 +342,7 @@ where
|
|||||||
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||||
RB: Fn(
|
RB: Fn(
|
||||||
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
||||||
) -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, sc_service::Error>
|
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
BIQ: FnOnce(
|
BIQ: FnOnce(
|
||||||
@@ -421,10 +423,10 @@ where
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
let rpc_client = client.clone();
|
let rpc_client = client.clone();
|
||||||
let rpc_extensions_builder = Box::new(move |_, _| rpc_ext_builder(rpc_client.clone()));
|
let rpc_builder = Box::new(move |_, _| rpc_ext_builder(rpc_client.clone()));
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
rpc_extensions_builder,
|
rpc_builder,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
@@ -542,7 +544,7 @@ where
|
|||||||
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||||
RB: Fn(
|
RB: Fn(
|
||||||
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
||||||
) -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, sc_service::Error>
|
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
BIQ: FnOnce(
|
BIQ: FnOnce(
|
||||||
@@ -621,7 +623,7 @@ where
|
|||||||
warp_sync: None,
|
warp_sync: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let rpc_extensions_builder = {
|
let rpc_builder = {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
let transaction_pool = transaction_pool.clone();
|
let transaction_pool = transaction_pool.clone();
|
||||||
|
|
||||||
@@ -632,12 +634,12 @@ where
|
|||||||
deny_unsafe,
|
deny_unsafe,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(rpc::create_full(deps))
|
rpc::create_full(deps).map_err(Into::into)
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
rpc_extensions_builder,
|
rpc_builder,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
@@ -782,7 +784,7 @@ pub async fn start_rococo_parachain_node(
|
|||||||
polkadot_config,
|
polkadot_config,
|
||||||
collator_options,
|
collator_options,
|
||||||
id,
|
id,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(RpcModule::new(())),
|
||||||
rococo_parachain_build_import_queue,
|
rococo_parachain_build_import_queue,
|
||||||
|client,
|
|client,
|
||||||
prometheus_registry,
|
prometheus_registry,
|
||||||
@@ -925,7 +927,7 @@ where
|
|||||||
polkadot_config,
|
polkadot_config,
|
||||||
collator_options,
|
collator_options,
|
||||||
id,
|
id,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(RpcModule::new(())),
|
||||||
shell_build_import_queue,
|
shell_build_import_queue,
|
||||||
|client,
|
|client,
|
||||||
prometheus_registry,
|
prometheus_registry,
|
||||||
@@ -1200,7 +1202,7 @@ where
|
|||||||
polkadot_config,
|
polkadot_config,
|
||||||
collator_options,
|
collator_options,
|
||||||
id,
|
id,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(RpcModule::new(())),
|
||||||
statemint_build_import_queue::<_, AuraId>,
|
statemint_build_import_queue::<_, AuraId>,
|
||||||
|client,
|
|client,
|
||||||
prometheus_registry,
|
prometheus_registry,
|
||||||
@@ -1365,7 +1367,7 @@ where
|
|||||||
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
|
||||||
RB: Fn(
|
RB: Fn(
|
||||||
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
Arc<TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>>,
|
||||||
) -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, sc_service::Error>
|
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
BIQ: FnOnce(
|
BIQ: FnOnce(
|
||||||
@@ -1444,7 +1446,7 @@ where
|
|||||||
warp_sync: None,
|
warp_sync: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let rpc_extensions_builder = {
|
let rpc_builder = {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
let transaction_pool = transaction_pool.clone();
|
let transaction_pool = transaction_pool.clone();
|
||||||
|
|
||||||
@@ -1455,12 +1457,12 @@ where
|
|||||||
deny_unsafe,
|
deny_unsafe,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(crate::rpc::create_canvas_kusama(deps))
|
crate::rpc::create_canvas_kusama(deps).map_err(Into::into)
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
rpc_extensions_builder,
|
rpc_builder,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
@@ -1603,7 +1605,7 @@ pub async fn start_canvas_kusama_node(
|
|||||||
polkadot_config,
|
polkadot_config,
|
||||||
collator_options,
|
collator_options,
|
||||||
id,
|
id,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(RpcModule::new(())),
|
||||||
canvas_kusama_build_import_queue,
|
canvas_kusama_build_import_queue,
|
||||||
|client,
|
|client,
|
||||||
prometheus_registry,
|
prometheus_registry,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ edition = "2021"
|
|||||||
async-trait = "0.1.53"
|
async-trait = "0.1.53"
|
||||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||||
criterion = { version = "0.3.5", features = [ "async_tokio" ] }
|
criterion = { version = "0.3.5", features = [ "async_tokio" ] }
|
||||||
jsonrpc-core = "18.0.0"
|
jsonrpsee = { version = "0.12.0", features = ["server"] }
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
serde = { version = "1.0.137", features = ["derive"] }
|
serde = { version = "1.0.137", features = ["derive"] }
|
||||||
|
|||||||
@@ -225,9 +225,7 @@ async fn start_node_impl<RB>(
|
|||||||
TransactionPool,
|
TransactionPool,
|
||||||
)>
|
)>
|
||||||
where
|
where
|
||||||
RB: Fn(Arc<Client>) -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, sc_service::Error>
|
RB: Fn(Arc<Client>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error> + Send + 'static,
|
||||||
+ Send
|
|
||||||
+ 'static,
|
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
if matches!(parachain_config.role, Role::Light) {
|
||||||
return Err("Light client not supported!".into())
|
return Err("Light client not supported!".into())
|
||||||
@@ -272,14 +270,14 @@ where
|
|||||||
warp_sync: None,
|
warp_sync: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let rpc_extensions_builder = {
|
let rpc_builder = {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
|
|
||||||
Box::new(move |_, _| rpc_ext_builder(client.clone()))
|
Box::new(move |_, _| rpc_ext_builder(client.clone()))
|
||||||
};
|
};
|
||||||
|
|
||||||
let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
rpc_extensions_builder,
|
rpc_builder,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
@@ -581,7 +579,7 @@ impl TestNodeBuilder {
|
|||||||
relay_chain_config,
|
relay_chain_config,
|
||||||
self.para_id,
|
self.para_id,
|
||||||
self.wrap_announce_block,
|
self.wrap_announce_block,
|
||||||
|_| Ok(Default::default()),
|
|_| Ok(jsonrpsee::RpcModule::new(())),
|
||||||
self.consensus,
|
self.consensus,
|
||||||
collator_options,
|
collator_options,
|
||||||
)
|
)
|
||||||
@@ -675,6 +673,10 @@ pub fn node_config(
|
|||||||
rpc_cors: None,
|
rpc_cors: None,
|
||||||
rpc_methods: Default::default(),
|
rpc_methods: Default::default(),
|
||||||
rpc_max_payload: None,
|
rpc_max_payload: None,
|
||||||
|
rpc_max_request_size: None,
|
||||||
|
rpc_max_response_size: None,
|
||||||
|
rpc_id_provider: None,
|
||||||
|
rpc_max_subs_per_conn: None,
|
||||||
ws_max_out_buffer_capacity: None,
|
ws_max_out_buffer_capacity: None,
|
||||||
prometheus_config: None,
|
prometheus_config: None,
|
||||||
telemetry_endpoints: None,
|
telemetry_endpoints: None,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use cumulus_primitives_core::ParaId;
|
|||||||
use cumulus_test_service::{initial_head_data, run_relay_chain_validator_node, Keyring::*};
|
use cumulus_test_service::{initial_head_data, run_relay_chain_validator_node, Keyring::*};
|
||||||
use futures::join;
|
use futures::join;
|
||||||
|
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test(flavor = "multi_thread")]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
async fn test_full_node_catching_up() {
|
async fn test_full_node_catching_up() {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use cumulus_test_service::{initial_head_data, run_relay_chain_validator_node, Ke
|
|||||||
use sc_client_api::{BlockBackend, UsageProvider};
|
use sc_client_api::{BlockBackend, UsageProvider};
|
||||||
use sp_runtime::generic::BlockId;
|
use sp_runtime::generic::BlockId;
|
||||||
|
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test(flavor = "multi_thread")]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
async fn test_migrate_solo_to_para() {
|
async fn test_migrate_solo_to_para() {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ use futures::StreamExt;
|
|||||||
use sc_client_api::BlockchainEvents;
|
use sc_client_api::BlockchainEvents;
|
||||||
use sp_runtime::generic::BlockId;
|
use sp_runtime::generic::BlockId;
|
||||||
|
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test(flavor = "multi_thread")]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
async fn test_runtime_upgrade() {
|
async fn test_runtime_upgrade() {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("runtime=debug");
|
let mut builder = sc_cli::LoggerBuilder::new("runtime=debug");
|
||||||
|
|||||||
Reference in New Issue
Block a user