diff --git a/Cargo.lock b/Cargo.lock index 3603ab4..0bb77fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.66", ] [[package]] @@ -779,9 +779,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -864,9 +864,9 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -984,7 +984,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.66", ] [[package]] @@ -1017,22 +1017,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.66", ] [[package]] @@ -1055,6 +1055,7 @@ dependencies = [ "hex", "prost", "prost-build", + "serde", ] [[package]] @@ -1120,9 +1121,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1159,7 +1160,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.66", ] [[package]] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index ec42de9..2d47c23 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -6,9 +6,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -prost = "0.10" +prost = "0.10.4" bitcoin = "0.29.0" base32 = "0.4.0" # for encoding Tor/Onion addresses +serde = { version = "1.0.203", features = ["derive"] } [build-dependencies] prost-build = "0.10" diff --git a/shared/build.rs b/shared/build.rs index 224df9c..29f77ec 100644 --- a/shared/build.rs +++ b/shared/build.rs @@ -6,10 +6,14 @@ use prost_build; fn main() { // Generate Rust types for the protobuf's - if let Err(e) = prost_build::compile_protos( - &["../protobuf/proto-types/wrapper.proto"], - &["../protobuf/proto-types/"], - ) { + if let Err(e) = prost_build::Config::new() + .compile_well_known_types() + .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") + .compile_protos( + &["../protobuf/proto-types/wrapper.proto"], + &["../protobuf/proto-types/"], + ) + { println!("Error while compiling protos: {}", e); panic!("Failed to code-gen the Rust structs from the Protobuf definitions"); }