Skip to content

Commit

Permalink
Merge pull request #1532 from zcash/zcb-refix-all-features-build
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom authored Sep 10, 2024
2 parents c97e9a1 + ee7cb69 commit e7abed3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
4 changes: 4 additions & 0 deletions zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this library adheres to Rust's notion of
type instead of a type parameter. This change allows for the simplification
of some type signatures.

### Fixed
- `zcash_client_backend::tor::grpc` now needs the `lightwalletd-tonic-tls-webpki-roots`
feature flag instead of `lightwalletd-tonic`, to fix compilation issues.

## [0.13.0] - 2024-08-20

`zcash_client_backend` now supports TEX (transparent-source-only) addresses as specified
Expand Down
23 changes: 4 additions & 19 deletions zcash_client_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,7 @@ exclude = ["*.proto"]
development = ["zcash_proofs"]

[package.metadata.docs.rs]
# Manually specify features while `orchard` is not in the public API.
#all-features = true
features = [
"lightwalletd-tonic",
"transparent-inputs",
"test-dependencies",
"tor",
"unstable",
"unstable-serialization",
"unstable-spanning-tree",
]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
Expand Down Expand Up @@ -162,6 +152,9 @@ zcash_protocol = { workspace = true, features = ["local-consensus"] }
## Enables the `tonic` gRPC client bindings for connecting to a `lightwalletd` server.
lightwalletd-tonic = ["dep:tonic", "hyper-util?/tokio"]

## Enables the `tls-webpki-roots` feature of `tonic`.
lightwalletd-tonic-tls-webpki-roots = ["lightwalletd-tonic", "tonic?/tls-webpki-roots"]

## Enables the `transport` feature of `tonic` producing a fully-featured client and server implementation
lightwalletd-tonic-transport = ["lightwalletd-tonic", "tonic?/transport"]

Expand Down Expand Up @@ -229,14 +222,6 @@ unstable-serialization = ["dep:byteorder"]
## Exposes the [`data_api::scanning::spanning_tree`] module.
unstable-spanning-tree = []

## Exposes access to the lightwalletd server via TOR
tor-lightwalletd-tonic = [
"tor",
"lightwalletd-tonic",
"tonic?/tls",
"tonic?/tls-webpki-roots"
]

[lib]
bench = false

Expand Down
10 changes: 5 additions & 5 deletions zcash_client_backend/src/tor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use arti_client::{config::TorClientConfigBuilder, TorClient};
use tor_rtcompat::PreferredRuntime;
use tracing::debug;

#[cfg(feature = "tor-lightwalletd-tonic")]
#[cfg(feature = "lightwalletd-tonic-tls-webpki-roots")]
mod grpc;

pub mod http;
Expand Down Expand Up @@ -76,7 +76,7 @@ impl Client {
pub enum Error {
/// The directory passed to [`Client::create`] does not exist.
MissingTorDirectory,
#[cfg(feature = "lightwalletd-tonic")]
#[cfg(feature = "lightwalletd-tonic-tls-webpki-roots")]
/// An error occurred while using gRPC-over-Tor.
Grpc(self::grpc::GrpcError),
/// An error occurred while using HTTP-over-Tor.
Expand All @@ -91,7 +91,7 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::MissingTorDirectory => write!(f, "Tor directory is missing"),
#[cfg(feature = "lightwalletd-tonic")]
#[cfg(feature = "lightwalletd-tonic-tls-webpki-roots")]
Error::Grpc(e) => write!(f, "gRPC-over-Tor error: {}", e),
Error::Http(e) => write!(f, "HTTP-over-Tor error: {}", e),
Error::Io(e) => write!(f, "IO error: {}", e),
Expand All @@ -104,7 +104,7 @@ impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Error::MissingTorDirectory => None,
#[cfg(feature = "lightwalletd-tonic")]
#[cfg(feature = "lightwalletd-tonic-tls-webpki-roots")]
Error::Grpc(e) => Some(e),
Error::Http(e) => Some(e),
Error::Io(e) => Some(e),
Expand All @@ -113,7 +113,7 @@ impl std::error::Error for Error {
}
}

#[cfg(feature = "lightwalletd-tonic")]
#[cfg(feature = "lightwalletd-tonic-tls-webpki-roots")]
impl From<self::grpc::GrpcError> for Error {
fn from(e: self::grpc::GrpcError) -> Self {
Error::Grpc(e)
Expand Down

0 comments on commit e7abed3

Please sign in to comment.