From 22a48d4d8d8ffd13c38d19510d77d558a50bb9b0 Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Mon, 21 Jun 2021 11:10:27 +0200 Subject: [PATCH 1/2] Add dummy Debug instance to AuthorityDiscoveryService. --- client/authority-discovery/src/service.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/authority-discovery/src/service.rs b/client/authority-discovery/src/service.rs index 1da97cbb03b53..533599c4897a2 100644 --- a/client/authority-discovery/src/service.rs +++ b/client/authority-discovery/src/service.rs @@ -16,6 +16,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use std::fmt::Debug; + use crate::ServicetoWorkerMsg; use futures::channel::{mpsc, oneshot}; @@ -30,6 +32,12 @@ pub struct Service { to_worker: mpsc::Sender, } +impl Debug for Service { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "sc_authority_discovery::Service(..)") + } +} + /// A [`Service`] allows to interact with a [`crate::Worker`], e.g. by querying the /// [`crate::Worker`]'s local address cache for a given [`AuthorityId`]. impl Service { From 9c97ecd2c91b44d2c165651a32ef2edff0257115 Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Tue, 22 Jun 2021 14:55:29 +0200 Subject: [PATCH 2/2] Update client/authority-discovery/src/service.rs More idiomatic print Co-authored-by: Pierre Krieger --- client/authority-discovery/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/authority-discovery/src/service.rs b/client/authority-discovery/src/service.rs index 533599c4897a2..a787ff8f51c21 100644 --- a/client/authority-discovery/src/service.rs +++ b/client/authority-discovery/src/service.rs @@ -34,7 +34,7 @@ pub struct Service { impl Debug for Service { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "sc_authority_discovery::Service(..)") + f.debug_tuple("AuthorityDiscoveryService").finish() } }