Skip to content

Commit

Permalink
feat(request-response): add modules for json and cbor messages
Browse files Browse the repository at this point in the history
This patch adds two modules to `libp2p::request_response`:

- `cbor`
- `json`

Both define a `Behaviour` type-alias that comes with a `Codec` implementation which uses the respective `serde` crate to serialize and deserialize the messages.

Fixes libp2p#3905.

Pull-Request: libp2p#3952.
  • Loading branch information
dgarus committed May 24, 2023
1 parent dc3a737 commit 29b5c7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl Behaviour {
let protocols = iter::once((DEFAULT_PROTOCOL_NAME, ProtocolSupport::Full));
let mut cfg = request_response::Config::default();
cfg.set_request_timeout(config.timeout);
let inner = request_response::Behaviour::new(AutoNatCodec, protocols, cfg);
let inner = request_response::Behaviour::with_codec(AutoNatCodec, protocols, cfg);
Self {
local_peer_id,
inner,
Expand Down

0 comments on commit 29b5c7d

Please sign in to comment.