openmina_core/p2p.rs
1/// TODO: These types and methods should be moved to `p2p` crate, they are here because they are used in `snark` crates callbacks
2use serde::{Deserialize, Serialize};
3
4#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Copy)]
5pub struct P2pNetworkPubsubMessageCacheId {
6 pub source: libp2p_identity::PeerId,
7 pub seqno: u64,
8}
9
10impl P2pNetworkPubsubMessageCacheId {
11 pub fn to_raw_bytes(&self) -> Vec<u8> {
12 let mut message_id = self.source.to_base58();
13 message_id.push_str(&self.seqno.to_string());
14 message_id.into_bytes()
15 }
16}