add display for peer meta
use crate::chain_storage::ChainMetadata;
use futures::{stream::Fuse, StreamExt};
+use std::fmt::{Display, Error, Formatter};
use tari_broadcast_channel::Subscriber;
use tari_comms::peer_manager::NodeId;
@@ -40,6 +41,13 @@ impl PeerChainMetadata {
}
}
+impl Display for PeerChainMetadata {
+ fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
+ writeln!(f, "Node ID: {}", self.node_id)?;
+ writeln!(f, "Chain metadata: {}", self.chain_metadata)
+ }
+}
+
#[derive(Debug)]
pub enum ChainMetadataEvent {
PeerChainMetadataReceived(Vec<PeerChainMetadata>),
