mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
relay-chain-interface: Do not depend on polkadot-service (#2287)
This commit is contained in:
Generated
-1
@@ -2250,7 +2250,6 @@ dependencies = [
|
||||
"jsonrpsee-core",
|
||||
"parity-scale-codec",
|
||||
"polkadot-overseer",
|
||||
"polkadot-service",
|
||||
"sc-client-api",
|
||||
"sp-api",
|
||||
"sp-blockchain",
|
||||
|
||||
@@ -367,7 +367,8 @@ pub fn build_inprocess_relay_chain(
|
||||
parachain_config,
|
||||
telemetry_worker_handle,
|
||||
hwbench,
|
||||
)?;
|
||||
)
|
||||
.map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let relay_chain_interface_builder = RelayChainInProcessInterfaceBuilder {
|
||||
polkadot_client: full_node.client.clone(),
|
||||
|
||||
@@ -6,7 +6,6 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
|
||||
cumulus-primitives-core = { path = "../../primitives/core" }
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
use std::{collections::BTreeMap, pin::Pin, sync::Arc};
|
||||
|
||||
use polkadot_overseer::prometheus::PrometheusError;
|
||||
use polkadot_service::SubstrateServiceError;
|
||||
use sc_client_api::StorageProof;
|
||||
|
||||
use futures::Stream;
|
||||
@@ -61,10 +60,8 @@ pub enum RelayChainError {
|
||||
WorkerCommunicationError(String),
|
||||
#[error("Scale codec deserialization error: {0}")]
|
||||
DeserializationError(CodecError),
|
||||
#[error("Polkadot service error: {0}")]
|
||||
ServiceError(#[from] polkadot_service::Error),
|
||||
#[error("Substrate service error: {0}")]
|
||||
SubServiceError(#[from] SubstrateServiceError),
|
||||
#[error(transparent)]
|
||||
Application(#[from] Box<dyn std::error::Error + Send + Sync + 'static>),
|
||||
#[error("Prometheus error: {0}")]
|
||||
PrometheusError(#[from] PrometheusError),
|
||||
#[error("Unspecified error occured: {0}")]
|
||||
|
||||
@@ -158,7 +158,8 @@ async fn new_minimal_relay_chain(
|
||||
client: relay_chain_rpc_client.clone(),
|
||||
spawn_handle: task_manager.spawn_handle(),
|
||||
genesis_hash,
|
||||
})?;
|
||||
})
|
||||
.map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let authority_discovery_service = build_authority_discovery_service(
|
||||
&task_manager,
|
||||
@@ -186,7 +187,8 @@ async fn new_minimal_relay_chain(
|
||||
overseer_args,
|
||||
&task_manager,
|
||||
relay_chain_rpc_client.clone(),
|
||||
)?;
|
||||
)
|
||||
.map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
network_starter.start_network();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ use cumulus_client_service::{
|
||||
start_full_node, BuildNetworkParams, StartCollatorParams, StartFullNodeParams,
|
||||
};
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
|
||||
// Substrate Imports
|
||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
@@ -162,10 +162,7 @@ async fn start_node_impl(
|
||||
hwbench.clone(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
|
||||
s => s.to_string().into(),
|
||||
})?;
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let force_authoring = parachain_config.force_authoring;
|
||||
let validator = parachain_config.role.is_authority();
|
||||
|
||||
@@ -28,7 +28,7 @@ use cumulus_primitives_core::{
|
||||
relay_chain::{Hash as PHash, PersistedValidationData},
|
||||
ParaId,
|
||||
};
|
||||
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use sp_core::Pair;
|
||||
|
||||
use jsonrpsee::RpcModule;
|
||||
@@ -382,10 +382,7 @@ where
|
||||
hwbench.clone(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
|
||||
s => s.to_string().into(),
|
||||
})?;
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let force_authoring = parachain_config.force_authoring;
|
||||
let validator = parachain_config.role.is_authority();
|
||||
@@ -572,10 +569,7 @@ where
|
||||
hwbench.clone(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
|
||||
s => s.to_string().into(),
|
||||
})?;
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let force_authoring = parachain_config.force_authoring;
|
||||
let validator = parachain_config.role.is_authority();
|
||||
@@ -1345,10 +1339,7 @@ where
|
||||
hwbench.clone(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
|
||||
s => s.to_string().into(),
|
||||
})?;
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let force_authoring = parachain_config.force_authoring;
|
||||
let validator = parachain_config.role.is_authority();
|
||||
|
||||
@@ -252,7 +252,8 @@ async fn build_relay_chain_interface(
|
||||
polkadot_service::IsCollator::Yes(CollatorPair::generate().0)
|
||||
},
|
||||
None,
|
||||
)?;
|
||||
)
|
||||
.map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
task_manager.add_child(relay_chain_full_node.task_manager);
|
||||
tracing::info!("Using inprocess node.");
|
||||
@@ -309,10 +310,7 @@ where
|
||||
&mut task_manager,
|
||||
)
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
|
||||
s => s.to_string().into(),
|
||||
})?;
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
let import_queue_service = params.import_queue.service();
|
||||
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||
|
||||
Reference in New Issue
Block a user