Skip to content

Commit bfba7a4

Browse files
refactor!: remove iroh_base::rpc (#2840)
Directly uses `serde_error::Error` instead Depends on n0-computer/iroh-blobs#5 ## Breaking Changes - removed - `iroh_base::rpc::RpcError` - `iroh_base::rpc::RpcResult` Closes #2839
1 parent 2d17636 commit bfba7a4

18 files changed

+255
-134
lines changed

Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ iroh-net = { path = "./iroh-net" }
5151
iroh-metrics = { path = "./iroh-metrics" }
5252
iroh-test = { path = "./iroh-test" }
5353
iroh-router = { path = "./iroh-router" }
54+
55+
iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "main" }

deny.toml

+5
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ license-files = [
3434
ignore = [
3535
"RUSTSEC-2024-0370", # unmaintained, no upgrade available
3636
]
37+
38+
[sources]
39+
allow-git = [
40+
"https://github.com/n0-computer/iroh-blobs.git",
41+
]

iroh-base/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ hex = "0.4.3"
2222
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"], optional = true }
2323
redb = { version = "2.0.0", optional = true }
2424
serde = { version = "1", features = ["derive"] }
25-
serde-error = "0.1.2"
2625
thiserror = "1"
2726

2827
# key module

iroh-base/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub mod key;
1313
#[cfg(feature = "key")]
1414
#[cfg_attr(iroh_docsrs, doc(cfg(feature = "key")))]
1515
pub mod node_addr;
16-
pub mod rpc;
1716
#[cfg(feature = "base32")]
1817
#[cfg_attr(iroh_docsrs, doc(cfg(feature = "base32")))]
1918
pub mod ticket;

iroh-base/src/rpc.rs

-34
This file was deleted.

iroh/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ console = { version = "0.15.5", optional = true }
6161

6262
# Documentation tests
6363
url = { version = "2.5.0", features = ["serde"] }
64+
serde-error = "0.1.3"
6465

6566
[features]
6667
default = ["metrics", "fs-store"]

iroh/src/client/docs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use anyhow::{anyhow, Context as _, Result};
1515
use bytes::Bytes;
1616
use derive_more::{Display, FromStr};
1717
use futures_lite::{Stream, StreamExt};
18-
use iroh_base::{key::PublicKey, node_addr::AddrInfoOptions, rpc::RpcError};
18+
use iroh_base::{key::PublicKey, node_addr::AddrInfoOptions};
1919
use iroh_blobs::{export::ExportProgress, store::ExportMode, Hash};
2020
#[doc(inline)]
2121
pub use iroh_docs::engine::{Origin, SyncEvent, SyncReason};
@@ -527,7 +527,7 @@ pub enum ImportProgress {
527527
/// We got an error and need to abort.
528528
///
529529
/// This will be the last message in the stream.
530-
Abort(RpcError),
530+
Abort(serde_error::Error),
531531
}
532532

533533
/// Intended capability for document share tickets

iroh/src/node.rs

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ mod protocol;
7373
mod rpc;
7474
mod rpc_status;
7575

76+
pub(crate) use self::rpc::{RpcError, RpcResult};
7677
pub use self::{
7778
builder::{
7879
Builder, DiscoveryConfig, DocsStorage, GcPolicy, ProtocolBuilder, StorageConfig,

0 commit comments

Comments
 (0)