Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade to blockstore 0.5 #43

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "Implementation of bitswap protocol for libp2p"
authors = ["Eiger <[email protected]>"]
homepage = "https://www.eiger.co"
readme = "README.md"
rust-version = "1.75"
repository = "https://github.com/eigerco/beetswap"
# crates.io is limited to 5 keywords and 5 categories
keywords = ["bitswap", "blockstore", "ipld", "cid"]
# Must be one of <https://crates.io/category_slugs>
categories = [
"asynchronous",
"cryptography::cryptocurrencies",
"network-programming",
"wasm",
]

[dependencies]
asynchronous-codec = "0.7"
blockstore = "0.4"
blockstore = "0.5"
bytes = "1"
cid = "0.11"
fnv = "1.0.5"
Expand Down Expand Up @@ -36,13 +49,15 @@ libp2p-noise = "0.44"
libp2p-stream = "0.1.0-alpha"
libp2p-swarm-test = "0.3.0"
libp2p-yamux = "0.45"
log = "0.4.18" # needed for minimal-versions
multihash = "0.19"
multihash-codetable = { version = "0.1", features = ["digest", "sha2"] }
tokio = { version = "1", features = ["rt", "macros", "time", "sync"] }
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }

# needed for minimal-versions
log = "0.4.18"

[features]
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen"]

Expand Down
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::Duration;
use std::{fmt, mem};

use asynchronous_codec::FramedWrite;
use blockstore::{Blockstore, BlockstoreError};
use blockstore::Blockstore;
use cid::CidGeneric;
use fnv::{FnvHashMap, FnvHashSet};
use futures_timer::Delay;
Expand Down Expand Up @@ -56,9 +56,9 @@ enum TaskResult<const S: usize> {
Get(
QueryId,
CidGeneric<S>,
Result<Option<Vec<u8>>, BlockstoreError>,
Result<Option<Vec<u8>>, blockstore::Error>,
),
Set(Result<Vec<(CidGeneric<S>, Vec<u8>)>, BlockstoreError>),
Set(Result<Vec<(CidGeneric<S>, Vec<u8>)>, blockstore::Error>),
Cancelled,
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::sync::Arc;
use std::task::{ready, Context, Poll};

use blockstore::{Blockstore, BlockstoreError};
use blockstore::Blockstore;
use cid::CidGeneric;
use client::SendingState;
use futures_util::stream::{SelectAll, StreamExt};
Expand Down Expand Up @@ -85,7 +85,7 @@ pub enum Error {

/// Error received when interacting with blockstore
#[error("Blockstore error: {0}")]
Blockstore(#[from] BlockstoreError),
Blockstore(#[from] blockstore::Error),
}

/// Alias for a [`Result`] with the error type [`beetswap::Error`].
Expand Down
4 changes: 2 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::Arc;
use std::task::{ready, Context, Poll};

use asynchronous_codec::FramedWrite;
use blockstore::{Blockstore, BlockstoreError};
use blockstore::Blockstore;
use cid::CidGeneric;
use fnv::{FnvHashMap, FnvHashSet};
use futures_util::sink::SinkExt;
Expand Down Expand Up @@ -58,7 +58,7 @@ enum TaskResult<const S: usize> {

struct GetCidResult<const S: usize> {
cid: CidGeneric<S>,
data: Result<Option<Vec<u8>>, BlockstoreError>,
data: Result<Option<Vec<u8>>, blockstore::Error>,
}

#[derive(Debug, Default)]
Expand Down
Loading