use core::fmt::{Debug, Display, Formatter};
use crate::{DiscoKeyPair, MachineKeyPair, NetworkLockKeyPair, NodeKeyPair};
#[derive(Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct NodeState {
pub disco_keys: DiscoKeyPair,
pub machine_keys: MachineKeyPair,
pub network_lock_keys: NetworkLockKeyPair,
pub node_keys: NodeKeyPair,
}
impl Debug for NodeState {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_tuple("NodeState")
.field(&self.machine_keys.public)
.field(&self.node_keys.public)
.field(&self.disco_keys.public)
.field(&self.network_lock_keys.public)
.finish()
}
}
impl Display for NodeState {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
Debug::fmt(self, f)
}
}
impl NodeState {
pub fn generate() -> Self {
Default::default()
}
}