From aacc251af93ae26cdf31292f186d24d11cde6cdd Mon Sep 17 00:00:00 2001
From: Ashley <ashley.ruglys@gmail.com>
Date: Wed, 24 Jun 2020 12:04:07 +0200
Subject: [PATCH]  Companion PR for `Fix the browser node and ensure it doesn't
 colour the informant output` #6457 (#1307)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Companion for Substrate #6269 (nested storage tx)

* Adjust to PR changes

* Bump to newest substrate

* Bump spec

* Switch branch

* Remove redundant informant_prefix

* Fix collator tests

* Update branch

* Revert "Switch branch"

This reverts commit bcce560c51fbc9db604cf3b0f615bfd21419f87d.

Co-authored-by: Alexander Theißen <alexander.theissen@parity.io>
---
 polkadot/cli/src/command.rs                        |  3 ---
 polkadot/collator/src/lib.rs                       |  5 -----
 polkadot/node/service/src/lib.rs                   | 14 +++-----------
 .../test-parachains/adder/collator/src/main.rs     |  1 -
 polkadot/service/src/lib.rs                        | 14 +++-----------
 5 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/polkadot/cli/src/command.rs b/polkadot/cli/src/command.rs
index 5e9d7838283..714e3c2ddac 100644
--- a/polkadot/cli/src/command.rs
+++ b/polkadot/cli/src/command.rs
@@ -128,7 +128,6 @@ pub fn run() -> Result<()> {
 							authority_discovery_enabled,
 							6000,
 							grandpa_pause,
-							None,
 						).map(|(s, _, _)| s)
 					},
 					service::KusamaExecutor::native_version().runtime_version
@@ -146,7 +145,6 @@ pub fn run() -> Result<()> {
 							authority_discovery_enabled,
 							6000,
 							grandpa_pause,
-							None,
 						).map(|(s, _, _)| s)
 					},
 					service::WestendExecutor::native_version().runtime_version
@@ -164,7 +162,6 @@ pub fn run() -> Result<()> {
 							authority_discovery_enabled,
 							6000,
 							grandpa_pause,
-							None,
 						).map(|(s, _, _)| s)
 					},
 					service::PolkadotExecutor::native_version().runtime_version
diff --git a/polkadot/collator/src/lib.rs b/polkadot/collator/src/lib.rs
index 7214731e0ca..063bdb1735c 100644
--- a/polkadot/collator/src/lib.rs
+++ b/polkadot/collator/src/lib.rs
@@ -373,7 +373,6 @@ pub async fn start_collator<P>(
 	para_id: ParaId,
 	key: Arc<CollatorPair>,
 	config: Configuration,
-	informant_prefix: Option<String>,
 ) -> Result<(), polkadot_service::Error>
 where
 	P: 'static + BuildParachainContext,
@@ -394,7 +393,6 @@ where
 			false,
 			6000,
 			None,
-			informant_prefix,
 		)?;
 		let spawn_handle = service.spawn_task_handle();
 		build_collator_service(
@@ -413,7 +411,6 @@ where
 			false,
 			6000,
 			None,
-			informant_prefix,
 		)?;
 		let spawn_handle = service.spawn_task_handle();
 		build_collator_service(
@@ -432,7 +429,6 @@ where
 			false,
 			6000,
 			None,
-			informant_prefix,
 		)?;
 		let spawn_handle = service.spawn_task_handle();
 		build_collator_service(
@@ -512,7 +508,6 @@ mod tests {
 			0.into(),
 			Arc::new(CollatorPair::generate().0),
 			config,
-			None,
 		));
 	}
 }
diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs
index e7fb7c50260..620850b3bd6 100644
--- a/polkadot/node/service/src/lib.rs
+++ b/polkadot/node/service/src/lib.rs
@@ -153,7 +153,7 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro
 /// Use this macro if you don't actually need the full service, but just the builder in order to
 /// be able to perform chain operations.
 macro_rules! new_full_start {
-	($config:expr, $runtime:ty, $executor:ty, $informant_prefix:expr $(,)?) => {{
+	($config:expr, $runtime:ty, $executor:ty) => {{
 		set_prometheus_registry(&mut $config)?;
 
 		let mut import_setup = None;
@@ -162,7 +162,6 @@ macro_rules! new_full_start {
 		let builder = service::ServiceBuilder::new_full::<
 			Block, $runtime, $executor
 		>($config)?
-			.with_informant_prefix($informant_prefix.unwrap_or_default())?
 			.with_select_chain(|_, backend| {
 				Ok(sc_consensus::LongestChain::new(backend.clone()))
 			})?
@@ -308,7 +307,6 @@ macro_rules! new_full {
 		$grandpa_pause:expr,
 		$runtime:ty,
 		$dispatch:ty,
-		$informant_prefix:expr $(,)?
 	) => {{
 		use sc_client_api::ExecutorProvider;
 		use sp_core::traits::BareCryptoStorePtr;
@@ -321,7 +319,7 @@ macro_rules! new_full {
 		let name = $config.network.node_name.clone();
 
 		let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
-			new_full_start!($config, $runtime, $dispatch, $informant_prefix);
+			new_full_start!($config, $runtime, $dispatch);
 
 		let service = builder
 			.with_finality_proof_provider(|client, backend| {
@@ -583,7 +581,7 @@ where
 	<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
 {
 	config.keystore = service::config::KeystoreConfig::InMemory;
-	Ok(new_full_start!(config, Runtime, Dispatch, None).0)
+	Ok(new_full_start!(config, Runtime, Dispatch).0)
 }
 
 /// Create a new Polkadot service for a full node.
@@ -595,7 +593,6 @@ pub fn polkadot_new_full(
 	_authority_discovery_enabled: bool,
 	_slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 )
 	-> Result<(
 		impl AbstractService,
@@ -614,7 +611,6 @@ pub fn polkadot_new_full(
 		grandpa_pause,
 		polkadot_runtime::RuntimeApi,
 		PolkadotExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, FullNodeHandles))
@@ -629,7 +625,6 @@ pub fn kusama_new_full(
 	_authority_discovery_enabled: bool,
 	_slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 ) -> Result<(
 		impl AbstractService,
 		Arc<impl PolkadotClient<
@@ -648,7 +643,6 @@ pub fn kusama_new_full(
 		grandpa_pause,
 		kusama_runtime::RuntimeApi,
 		KusamaExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, FullNodeHandles))
@@ -663,7 +657,6 @@ pub fn westend_new_full(
 	_authority_discovery_enabled: bool,
 	_slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 )
 	-> Result<(
 		impl AbstractService,
@@ -682,7 +675,6 @@ pub fn westend_new_full(
 		grandpa_pause,
 		westend_runtime::RuntimeApi,
 		WestendExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, FullNodeHandles))
diff --git a/polkadot/parachain/test-parachains/adder/collator/src/main.rs b/polkadot/parachain/test-parachains/adder/collator/src/main.rs
index d69e4e3d926..a32b6e4ca4e 100644
--- a/polkadot/parachain/test-parachains/adder/collator/src/main.rs
+++ b/polkadot/parachain/test-parachains/adder/collator/src/main.rs
@@ -139,7 +139,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
 			id,
 			key,
 			config,
-			None,
 		).map_err(|e| e.into())
 	})?;
 
diff --git a/polkadot/service/src/lib.rs b/polkadot/service/src/lib.rs
index 0f64f41bf9f..82e8460437a 100644
--- a/polkadot/service/src/lib.rs
+++ b/polkadot/service/src/lib.rs
@@ -149,7 +149,7 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro
 /// Use this macro if you don't actually need the full service, but just the builder in order to
 /// be able to perform chain operations.
 macro_rules! new_full_start {
-	($config:expr, $runtime:ty, $executor:ty, $informant_prefix:expr $(,)?) => {{
+	($config:expr, $runtime:ty, $executor:ty) => {{
 		set_prometheus_registry(&mut $config)?;
 
 		let mut import_setup = None;
@@ -158,7 +158,6 @@ macro_rules! new_full_start {
 		let builder = service::ServiceBuilder::new_full::<
 			Block, $runtime, $executor
 		>($config)?
-			.with_informant_prefix($informant_prefix.unwrap_or_default())?
 			.with_select_chain(|_, backend| {
 				Ok(sc_consensus::LongestChain::new(backend.clone()))
 			})?
@@ -276,7 +275,6 @@ macro_rules! new_full {
 		$grandpa_pause:expr,
 		$runtime:ty,
 		$dispatch:ty,
-		$informant_prefix:expr $(,)?
 	) => {{
 		use sc_network::Event;
 		use sc_client_api::ExecutorProvider;
@@ -298,7 +296,7 @@ macro_rules! new_full {
 		let slot_duration = $slot_duration;
 
 		let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
-			new_full_start!($config, $runtime, $dispatch, $informant_prefix);
+			new_full_start!($config, $runtime, $dispatch);
 
 		let service = builder
 			.with_finality_proof_provider(|client, backend| {
@@ -649,7 +647,7 @@ where
 	<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
 {
 	config.keystore = service::config::KeystoreConfig::InMemory;
-	Ok(new_full_start!(config, Runtime, Dispatch, None).0)
+	Ok(new_full_start!(config, Runtime, Dispatch).0)
 }
 
 /// Create a new Polkadot service for a full node.
@@ -661,7 +659,6 @@ pub fn polkadot_new_full(
 	authority_discovery_enabled: bool,
 	slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 )
 	-> Result<(
 		impl AbstractService,
@@ -682,7 +679,6 @@ pub fn polkadot_new_full(
 		grandpa_pause,
 		polkadot_runtime::RuntimeApi,
 		PolkadotExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, handles))
@@ -697,7 +693,6 @@ pub fn kusama_new_full(
 	authority_discovery_enabled: bool,
 	slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 ) -> Result<(
 		impl AbstractService,
 		Arc<impl PolkadotClient<
@@ -718,7 +713,6 @@ pub fn kusama_new_full(
 		grandpa_pause,
 		kusama_runtime::RuntimeApi,
 		KusamaExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, handles))
@@ -733,7 +727,6 @@ pub fn westend_new_full(
 	authority_discovery_enabled: bool,
 	slot_duration: u64,
 	grandpa_pause: Option<(u32, u32)>,
-	informant_prefix: Option<String>,
 )
 	-> Result<(
 		impl AbstractService,
@@ -754,7 +747,6 @@ pub fn westend_new_full(
 		grandpa_pause,
 		westend_runtime::RuntimeApi,
 		WestendExecutor,
-		informant_prefix,
 	);
 
 	Ok((service, client, handles))
-- 
GitLab