fedimint_server/consensus/aleph_bft/
mod.rspub mod backup;
pub mod data_provider;
pub mod finalization_handler;
pub mod keychain;
pub mod network;
pub mod spawner;
use aleph_bft::NodeIndex;
use fedimint_core::encoding::{Decodable, Encodable};
use fedimint_core::PeerId;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Encodable, Decodable, Serialize, Deserialize)]
pub struct Message(Vec<u8>);
pub fn to_peer_id(node_index: NodeIndex) -> PeerId {
u16::try_from(usize::from(node_index))
.expect("The node index corresponds to a valid PeerId")
.into()
}
pub fn to_node_index(peer_id: PeerId) -> NodeIndex {
usize::from(u16::from(peer_id)).into()
}