Skip to content

Commit

Permalink
follow libp2p pattern for proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Feb 12, 2025
1 parent 0c09ca4 commit 6ed5a32
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions anchor/network/src/handshake/envelope/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use crate::handshake::envelope::{parse_envelope, Envelope};
use async_trait::async_trait;
use futures::{AsyncReadExt, AsyncWriteExt};
use libp2p::futures::{AsyncRead, AsyncWrite};
use libp2p::request_response::Codec as RequestResponseCodec;
use libp2p::StreamProtocol;
use libp2p::{request_response, StreamProtocol};
use std::io;
use tracing::debug;

Expand All @@ -21,7 +20,7 @@ impl From<envelope::Error> for io::Error {
pub struct Codec;

#[async_trait]
impl RequestResponseCodec for Codec {
impl request_response::Codec for Codec {
type Protocol = StreamProtocol;
type Request = Envelope;
type Response = Envelope;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod pb;
1 change: 1 addition & 0 deletions anchor/network/src/handshake/envelope/generated/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod message;
4 changes: 2 additions & 2 deletions anchor/network/src/handshake/envelope/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod codec;
mod envelope;
mod generated;

use crate::handshake::node_info::NodeInfo;
use discv5::libp2p_identity::PublicKey;
Expand Down Expand Up @@ -73,4 +73,4 @@ pub fn make_unsigned(

use crate::handshake::envelope::Error::SignatureVerification;
pub use codec::Codec;
pub use envelope::Envelope;
pub use generated::message::pb::Envelope;

0 comments on commit 6ed5a32

Please sign in to comment.