From 9bd29f08a6c92c4e005f30c02e198bba02322a57 Mon Sep 17 00:00:00 2001 From: Yiannis Marangos Date: Fri, 29 Mar 2024 12:59:08 +0200 Subject: [PATCH 1/2] chore: Removed unneeded Send/Sync constrains --- src/builder.rs | 4 ++-- src/client.rs | 4 ++-- src/lib.rs | 6 +++--- src/server.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 609db75..f02232f 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -20,7 +20,7 @@ use crate::{Behaviour, Error, Result}; /// # } pub struct BehaviourBuilder where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { protocol_prefix: Option, blockstore: B, @@ -30,7 +30,7 @@ where impl BehaviourBuilder where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { /// Creates a new builder for [`Behaviour`]. pub(crate) fn new(blockstore: B) -> Self { diff --git a/src/client.rs b/src/client.rs index 113362c..5e79dde 100644 --- a/src/client.rs +++ b/src/client.rs @@ -63,7 +63,7 @@ enum TaskResult { #[derive(Debug)] pub(crate) struct ClientBehaviour where - B: Blockstore + Send + Sync, + B: Blockstore, { store: Arc, protocol: StreamProtocol, @@ -97,7 +97,7 @@ pub enum SendingState { impl ClientBehaviour where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { pub(crate) fn new(config: ClientConfig, store: Arc, protocol_prefix: Option<&str>) -> Self { let protocol = stream_protocol(protocol_prefix, "/ipfs/bitswap/1.2.0") diff --git a/src/lib.rs b/src/lib.rs index 4bdcafb..65755e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ pub use crate::client::QueryId; #[derive(Debug)] pub struct Behaviour where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { protocol: StreamProtocol, client: ClientBehaviour, @@ -95,7 +95,7 @@ pub type Result = std::result::Result; impl Behaviour where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { /// Creates a new [`Behaviour`] with the default configuration. pub fn new(blockstore: B) -> Behaviour { @@ -122,7 +122,7 @@ where impl NetworkBehaviour for Behaviour where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { type ConnectionHandler = ConnHandler; type ToSwarm = Event; diff --git a/src/server.rs b/src/server.rs index d0c6bb1..c449aa6 100644 --- a/src/server.rs +++ b/src/server.rs @@ -133,7 +133,7 @@ impl PeerWantlist { impl ServerBehaviour where - B: Blockstore + Send + Sync + 'static, + B: Blockstore + 'static, { pub(crate) fn new(store: Arc, protocol_prefix: Option<&str>) -> Self { let protocol = stream_protocol(protocol_prefix, "/ipfs/bitswap/1.2.0") From e9b43cbf43fbee6adce199db7bf70b97a434b6a0 Mon Sep 17 00:00:00 2001 From: Yiannis Marangos Date: Tue, 2 Apr 2024 14:49:33 +0300 Subject: [PATCH 2/2] upgrade blockstore --- Cargo.lock | 5 ++--- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1114c3f..e47152b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,11 +389,10 @@ dependencies = [ [[package]] name = "blockstore" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bff157a9c999bf0a39ca45e0b62076aa27135012cfbf9cc54ad1cf971876f0" +checksum = "359816e624b0ab1d2ecaef2a07d3820d7078a16ad55f1f1c381422971c418acf" dependencies = [ - "async-trait", "cid", "dashmap", "multihash", diff --git a/Cargo.toml b/Cargo.toml index 9f9c291..94c8dca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "Implementation of bitswap protocol for libp2p" [dependencies] async-trait = "0.1" asynchronous-codec = "0.7" -blockstore = "0.1" +blockstore = "0.3" bytes = "1" cid = "0.11" fnv = "1.0.5"