Skip to content

Commit

Permalink
chore: Update dependency (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 authored Sep 24, 2023
1 parent 7883d36 commit 50ac9e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ either = "1"
void = "1"

#ipfs dependency
rust-ipfs = "0.4.3"
rust-ipfs = "0.4.4"

# Blink related crates
# av-data is needed to use libaom. need to ensure that Warp and libaom use the same version of av-data
Expand Down
35 changes: 7 additions & 28 deletions extensions/warp-ipfs/src/behaviour/phonebook.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
mod handler;

use std::{
collections::{hash_map::Entry, HashMap, HashSet, VecDeque},
task::{Context, Poll},
Expand All @@ -8,9 +6,8 @@ use std::{
use rust_ipfs::libp2p::{
core::Endpoint,
swarm::{
derive_prelude::ConnectionEstablished, ConnectionClosed, ConnectionDenied,
ConnectionHandler, ConnectionId, FromSwarm, NotifyHandler, PollParameters, THandler,
THandlerInEvent, THandlerOutEvent, ToSwarm,
derive_prelude::ConnectionEstablished, ConnectionClosed, ConnectionDenied, ConnectionId,
FromSwarm, PollParameters, THandler, THandlerInEvent, THandlerOutEvent, ToSwarm,
},
Multiaddr, PeerId,
};
Expand Down Expand Up @@ -123,7 +120,7 @@ impl Behaviour {
}

impl NetworkBehaviour for Behaviour {
type ConnectionHandler = handler::Handler;
type ConnectionHandler = rust_ipfs::libp2p::swarm::dummy::ConnectionHandler;
type ToSwarm = void::Void;

fn handle_pending_inbound_connection(
Expand All @@ -148,29 +145,21 @@ impl NetworkBehaviour for Behaviour {
fn handle_established_inbound_connection(
&mut self,
_: ConnectionId,
peer_id: PeerId,
_: PeerId,
_: &Multiaddr,
_: &Multiaddr,
) -> Result<THandler<Self>, ConnectionDenied> {
let mut handler = handler::Handler::default();
if self.entry.contains(&peer_id) {
handler.on_behaviour_event(handler::In::Set);
}
Ok(handler)
Ok(rust_ipfs::libp2p::swarm::dummy::ConnectionHandler)
}

fn handle_established_outbound_connection(
&mut self,
_: ConnectionId,
peer_id: PeerId,
_: PeerId,
_: &Multiaddr,
_: Endpoint,
) -> Result<THandler<Self>, ConnectionDenied> {
let mut handler = handler::Handler::default();
if self.entry.contains(&peer_id) {
handler.on_behaviour_event(handler::In::Set);
}
Ok(handler)
Ok(rust_ipfs::libp2p::swarm::dummy::ConnectionHandler)
}

fn on_connection_handler_event(
Expand Down Expand Up @@ -246,11 +235,6 @@ impl NetworkBehaviour for Behaviour {
}

self.send_online_event(peer_id);
self.events.push_back(ToSwarm::NotifyHandler {
peer_id,
handler: NotifyHandler::Any,
event: handler::In::Set,
});
let _ = response.send(Ok(()));
}
Poll::Ready(Some(PhoneBookCommand::RemoveEntry { peer_id, response })) => {
Expand All @@ -260,11 +244,6 @@ impl NetworkBehaviour for Behaviour {
}

self.send_offline_event(peer_id);
self.events.push_back(ToSwarm::NotifyHandler {
peer_id,
handler: NotifyHandler::Any,
event: handler::In::Unset,
});
let _ = response.send(Ok(()));
}
Poll::Ready(None) => unreachable!("Channels are owned"),
Expand Down
99 changes: 0 additions & 99 deletions extensions/warp-ipfs/src/behaviour/phonebook/handler.rs

This file was deleted.

0 comments on commit 50ac9e0

Please sign in to comment.