From 2159027931ab18d235f45a7b7016d84bb587707b Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Mon, 9 Oct 2023 22:10:40 +0530 Subject: [PATCH] chore(deps): upgrade tonic and prost --- Cargo.lock | 122 +++++++++++++++++++++++++++----------- Cargo.toml | 10 ++-- src/api/server/convert.rs | 6 +- src/cli/api_client.rs | 2 +- 4 files changed, 95 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a204bb3..fd679bb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -498,7 +498,7 @@ dependencies = [ "lazy_static", "opentelemetry", "opentelemetry-otlp", - "prost 0.11.9", + "prost 0.12.1", "prost-wkt-types", "protobuf-src", "rand", @@ -518,8 +518,8 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tonic 0.9.2", - "tonic-build 0.9.2", + "tonic 0.10.2", + "tonic-build 0.10.2", "tonic-health", "tonic_lnd", "tracing", @@ -2219,12 +2219,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] @@ -2275,6 +2275,16 @@ dependencies = [ "prost-derive 0.11.9", ] +[[package]] +name = "prost" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +dependencies = [ + "bytes", + "prost-derive 0.12.1", +] + [[package]] name = "prost-build" version = "0.8.0" @@ -2295,22 +2305,22 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ "bytes", "heck 0.4.1", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph 0.6.4", "prettyplease", - "prost 0.11.9", - "prost-types 0.11.9", + "prost 0.12.1", + "prost-types 0.12.1", "regex", - "syn 1.0.109", + "syn 2.0.29", "tempfile", "which", ] @@ -2354,6 +2364,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "prost-types" version = "0.8.0" @@ -2366,22 +2389,22 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ - "prost 0.11.9", + "prost 0.12.1", ] [[package]] name = "prost-wkt" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562788060bcf2bfabe055194bd991ed2442457661744c88e0a0828ff9a08c08b" +checksum = "4d8ef9c3f0f1dab910d2b7e2c24a8e4322e122eba6d7a1921eeebcebbc046c40" dependencies = [ "chrono", "inventory", - "prost 0.11.9", + "prost 0.12.1", "serde", "serde_derive", "serde_json", @@ -2390,27 +2413,27 @@ dependencies = [ [[package]] name = "prost-wkt-build" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4dca8bcead3b728a6a7da017cc95e7f4cb2320ec4f6896bc593a1c4700f7328" +checksum = "5b31cae9a54ca84fee1504740a82eebf2479532905e106f63ca0c3bc8d780321" dependencies = [ "heck 0.4.1", - "prost 0.11.9", - "prost-build 0.11.9", - "prost-types 0.11.9", + "prost 0.12.1", + "prost-build 0.12.1", + "prost-types 0.12.1", "quote", ] [[package]] name = "prost-wkt-types" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2377c5680f2342871823045052e791b4487f7c90aae17e0feaee24cf59578a34" +checksum = "435be4a8704091b4c5fb1d79799de7f2dbff53af05edf29385237f8cf7ab37ee" dependencies = [ "chrono", - "prost 0.11.9", - "prost-build 0.11.9", - "prost-types 0.11.9", + "prost 0.12.1", + "prost-build 0.12.1", + "prost-types 0.12.1", "prost-wkt", "prost-wkt-build", "protobuf-src", @@ -3731,6 +3754,33 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.3", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.1", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tonic-build" version = "0.5.2" @@ -3745,28 +3795,28 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.9.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ "prettyplease", "proc-macro2", - "prost-build 0.11.9", + "prost-build 0.12.1", "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] name = "tonic-health" -version = "0.9.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080964d45894b90273d2b1dd755fdd114560db8636bb41cea615213c45043c4d" +checksum = "f80db390246dfb46553481f6024f0082ba00178ea495dbb99e70ba9a4fafb5e1" dependencies = [ "async-stream", - "prost 0.11.9", + "prost 0.12.1", "tokio", "tokio-stream", - "tonic 0.9.2", + "tonic 0.10.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 53179dc8..a534f2ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,14 +23,14 @@ sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres", "rus sqlxmq = { git = "https://github.com/GaloyMoney/sqlxmq", rev = "f03f73c", default-features = false, features = ["runtime-tokio-rustls"] } tokio = { version = "1.32", features = ["rt-multi-thread", "macros"] } tokio-stream = { version = "0.1.14", features = ["sync"] } -tonic = "0.9" -tonic-health = "0.9" +tonic = "0.10.2" +tonic-health = "0.10.2" rust_decimal = "1.32" tracing = "0.1.37" tracing-opentelemetry = "0.21.0" tracing-subscriber = { version = "0.3.17", features = ["env-filter", "json"] } -prost = "0.11" -prost-wkt-types = { version = "0.4.2", features = ["vendored-protoc"]} +prost = "0.12" +prost-wkt-types = { version = "0.5", features = ["vendored-protoc"]} rust_decimal_macros = "1.32" rusty-money = "0.4.1" thiserror = "1.0.48" @@ -54,4 +54,4 @@ regex = "1.9.3" [build-dependencies] protobuf-src = { version = "1.1.0" } -tonic-build = { version = "0.9", features = ["prost"] } +tonic-build = { version = "0.10.2", features = ["prost"] } diff --git a/src/api/server/convert.rs b/src/api/server/convert.rs index d14c57d8..15ba6512 100644 --- a/src/api/server/convert.rs +++ b/src/api/server/convert.rs @@ -194,7 +194,7 @@ impl From for proto::Payout { impl From for proto::Wallet { fn from(wallet: Wallet) -> Self { let id = wallet.id.to_string(); - let name = wallet.name as String; + let name = wallet.name; let config: proto::WalletConfig = proto::WalletConfig::from(wallet.config); proto::Wallet { id, @@ -265,7 +265,7 @@ impl From for proto::SigningSession { impl From for PayoutQueueConfig { fn from(proto_config: proto::PayoutQueueConfig) -> Self { let tx_priority = - proto::TxPriority::from_i32(proto_config.tx_priority).map(TxPriority::from); + proto::TxPriority::try_from(proto_config.tx_priority).map(TxPriority::from); let consolidate_deprecated_keychains = proto_config.consolidate_deprecated_keychains; let trigger = match proto_config.trigger { @@ -288,7 +288,7 @@ impl From for PayoutQueueConfig { if let Some(trigger) = trigger { ret.trigger = trigger; } - if let Some(tx_priority) = tx_priority { + if let Ok(tx_priority) = tx_priority { ret.tx_priority = tx_priority; } ret diff --git a/src/cli/api_client.rs b/src/cli/api_client.rs index ebc863f7..5a3e08d1 100644 --- a/src/cli/api_client.rs +++ b/src/cli/api_client.rs @@ -484,7 +484,7 @@ impl ApiClient { .into_iter() .map(|bg| { let tx_priority = TxPriority::from( - proto::TxPriority::from_i32(bg.config.as_ref().unwrap().tx_priority).unwrap(), + proto::TxPriority::try_from(bg.config.as_ref().unwrap().tx_priority).unwrap(), ); let mut json = serde_json::to_value(bg).unwrap(); json.as_object_mut()