From d1595d1f87ef1488924f5675a0c98a49798812c0 Mon Sep 17 00:00:00 2001 From: Asone Date: Thu, 2 Jun 2022 15:48:38 +0200 Subject: [PATCH] bump dependencies (#34) * bump dependencies Signed-off-by: Asone * update: use map instead of and_then when creating lazy connection Signed-off-by: Asone --- Cargo.toml | 6 +++--- build.rs | 1 - src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 35d0398..37bcdcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ license = "MIT" name = "lnd" [dependencies] -tonic = { version = "0.6", features = ["transport", "codegen", "prost"], default-features = false } -prost = { version = "0.9", default-features = false } +tonic = { version = "0.7.2", features = ["transport", "codegen", "prost"], default-features = false } +prost = { version = "0.10.4", default-features = false } openssl = { version = "0.10", default-features = false } hyper = { version = "0.14", default-features = false } hyper-openssl = { version = "0.9", default-features = false } @@ -18,4 +18,4 @@ hex = { version = "0.4", features = ["std"], default-features = false } thiserror = { version = "1.0", default-features = false } [build-dependencies] -tonic-build = "0.6" +tonic-build = "0.7.2" diff --git a/build.rs b/build.rs index 1e106f3..3d90748 100644 --- a/build.rs +++ b/build.rs @@ -13,6 +13,5 @@ fn main() -> Result<(), std::io::Error> { tonic_build::configure() .build_server(false) .out_dir(BUILD_DIR) - .format(false) .compile(&PROTOS, &[PROTOS_NS]) } diff --git a/src/lib.rs b/src/lib.rs index c49e615..bf1af74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,7 +79,7 @@ impl Lnd { Lnd::connector(certificate_bytes).map_err(LndConnectError::Connector)?; let transport = tonic::transport::Endpoint::new(destination) - .and_then(move |d| d.connect_with_connector_lazy(https_connector)) + .map(move |d| d.connect_with_connector_lazy(https_connector)) .map_err(LndConnectError::Transport)?; Ok(Lnd::build(transport, LndInterceptor::noop())) @@ -142,7 +142,7 @@ struct LndInterceptor { impl LndInterceptor { fn macaroon(bytes: &[u8]) -> Result { - let macaroon = Some(MetadataValue::from_str(&hex::encode(bytes))?); + let macaroon = Some(MetadataValue::try_from(&hex::encode(bytes))?); Ok(Self { macaroon }) }