Refactor protocols names

This commit is contained in:
danielSanchezQ 2024-08-01 16:02:15 +02:00
parent 33aea058c4
commit 4518e23177
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,4 @@
use libp2p::StreamProtocol;
pub const PROTOCOL_NAME: StreamProtocol = StreamProtocol::new("/nomos/da/0.1.0");
pub const REPLICATION_PROTOCOL: StreamProtocol = StreamProtocol::new("/nomos/da/0.1.0/replication");
pub const DISPERSAL_PROTOCOL: StreamProtocol = StreamProtocol::new("/nomos/da/0.1.0/dispersal");

View File

@ -16,7 +16,7 @@ use tracing::error;
// internal
use nomos_da_messages::{pack_message, unpack_from_reader};
use crate::protocol::PROTOCOL_NAME;
use crate::protocol::REPLICATION_PROTOCOL;
pub type DaMessage = nomos_da_messages::replication::ReplicationReq;
@ -185,7 +185,7 @@ impl ConnectionHandler for ReplicationHandler {
type OutboundOpenInfo = ();
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
SubstreamProtocol::new(ReadyUpgrade::new(PROTOCOL_NAME), ())
SubstreamProtocol::new(ReadyUpgrade::new(REPLICATION_PROTOCOL), ())
}
fn poll(