Skip to content

Commit

Permalink
add: serde Serialize and Deserialize attrs to events
Browse files Browse the repository at this point in the history
  • Loading branch information
0xB10C committed May 29, 2024
1 parent f9919ab commit ac3ad7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
29 changes: 15 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 8 additions & 4 deletions shared/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit ac3ad7b

Please sign in to comment.