Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit e9d41e4

Browse files
author
Joonas Koivunen
committed
refactor: rename bitswap as ipfs-bitswap
1 parent a785c85 commit e9d41e4

File tree

5 files changed

+41
-28
lines changed

5 files changed

+41
-28
lines changed

Cargo.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ anyhow = { default-features = false, version = "1.0" }
1515
async-stream = { default-features = false, version = "0.3" }
1616
async-trait = { default-features = false, version = "0.1" }
1717
base64 = { default-features = false, features = ["alloc"], version = "0.12" }
18-
bitswap = { path = "bitswap" }
18+
ipfs-bitswap = { path = "bitswap" }
1919
byteorder = { default-features = false, version = "1.3" }
2020
bytes = { default-features = false, version = "0.5" }
2121
cid = { default-features = false, version = "0.5" }

bitswap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Rust-IPFS contributors"]
33
edition = "2018"
4-
name = "bitswap"
4+
name = "ipfs-bitswap"
55
version = "0.1.0"
66

77
[build-dependencies]

src/lib.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ pub use self::{
8181
path::IpfsPath,
8282
repo::{PinKind, PinMode, RepoTypes},
8383
};
84-
pub use bitswap::Block;
8584
pub use cid::Cid;
85+
pub use ipfs_bitswap::Block;
8686
pub use libp2p::{
8787
core::{connection::ListenerId, multiaddr::Protocol, Multiaddr, PeerId, PublicKey},
8888
identity::Keypair,
@@ -260,7 +260,10 @@ enum IpfsEvent {
260260
PubsubPublish(String, Vec<u8>, OneshotSender<()>),
261261
PubsubPeers(Option<String>, OneshotSender<Vec<PeerId>>),
262262
PubsubSubscribed(OneshotSender<Vec<String>>),
263-
WantList(Option<PeerId>, OneshotSender<Vec<(Cid, bitswap::Priority)>>),
263+
WantList(
264+
Option<PeerId>,
265+
OneshotSender<Vec<(Cid, ipfs_bitswap::Priority)>>,
266+
),
264267
BitswapStats(OneshotSender<BitswapStats>),
265268
AddListeningAddress(Multiaddr, Channel<Multiaddr>),
266269
RemoveListeningAddress(Multiaddr, Channel<()>),
@@ -809,7 +812,7 @@ impl<Types: IpfsTypes> Ipfs<Types> {
809812
pub async fn bitswap_wantlist(
810813
&self,
811814
peer: Option<PeerId>,
812-
) -> Result<Vec<(Cid, bitswap::Priority)>, Error> {
815+
) -> Result<Vec<(Cid, ipfs_bitswap::Priority)>, Error> {
813816
async move {
814817
let (tx, rx) = oneshot_channel();
815818

@@ -1568,12 +1571,22 @@ pub struct BitswapStats {
15681571
/// The current peers
15691572
pub peers: Vec<PeerId>,
15701573
/// The wantlist of the local node
1571-
pub wantlist: Vec<(Cid, bitswap::Priority)>,
1574+
pub wantlist: Vec<(Cid, ipfs_bitswap::Priority)>,
15721575
}
15731576

1574-
impl From<(bitswap::Stats, Vec<PeerId>, Vec<(Cid, bitswap::Priority)>)> for BitswapStats {
1577+
impl
1578+
From<(
1579+
ipfs_bitswap::Stats,
1580+
Vec<PeerId>,
1581+
Vec<(Cid, ipfs_bitswap::Priority)>,
1582+
)> for BitswapStats
1583+
{
15751584
fn from(
1576-
(stats, peers, wantlist): (bitswap::Stats, Vec<PeerId>, Vec<(Cid, bitswap::Priority)>),
1585+
(stats, peers, wantlist): (
1586+
ipfs_bitswap::Stats,
1587+
Vec<PeerId>,
1588+
Vec<(Cid, ipfs_bitswap::Priority)>,
1589+
),
15771590
) -> Self {
15781591
BitswapStats {
15791592
blocks_sent: stats.sent_blocks.load(Ordering::Relaxed),

src/p2p/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::repo::{BlockPut, Repo};
66
use crate::subscription::{SubscriptionFuture, SubscriptionRegistry};
77
use crate::IpfsTypes;
88
use anyhow::anyhow;
9-
use bitswap::{Bitswap, BitswapEvent};
109
use cid::Cid;
10+
use ipfs_bitswap::{Bitswap, BitswapEvent};
1111
use libp2p::core::{Multiaddr, PeerId};
1212
use libp2p::identify::{Identify, IdentifyEvent};
1313
use libp2p::kad::record::{store::MemoryStore, Key, Record};

0 commit comments

Comments
 (0)