From a38d81dee0a5a0ba7a03b7aa8bc125f1c496cb08 Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:47:35 +0100 Subject: [PATCH] cln-grpc: Derive serde Serialize/Deserialize for types --- Cargo.lock | 1 + cln-grpc/Cargo.toml | 1 + cln-grpc/build.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 7d6c272a9..414e2ee90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,6 +267,7 @@ dependencies = [ "hex", "log", "prost", + "serde", "serde_json", "tonic", "tonic-build", diff --git a/cln-grpc/Cargo.toml b/cln-grpc/Cargo.toml index 1a84626cb..db0da3d7c 100644 --- a/cln-grpc/Cargo.toml +++ b/cln-grpc/Cargo.toml @@ -18,6 +18,7 @@ log = "0.4" cln-rpc = { path="../cln-rpc/", version = "^0.1", optional = true } tonic = { version = "0.8", features = ["tls", "transport"] } prost = "0.11" +serde = { version = "1.0", features = ["derive"] } hex = "0.4.3" bitcoin = { version = "0.30", features = [ "serde" ] } diff --git a/cln-grpc/build.rs b/cln-grpc/build.rs index cd13d0529..ee1a50917 100644 --- a/cln-grpc/build.rs +++ b/cln-grpc/build.rs @@ -1,6 +1,7 @@ fn main() { let builder = tonic_build::configure(); builder + .type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]") .protoc_arg("--experimental_allow_proto3_optional") .compile(&["proto/node.proto"], &["proto"]) .unwrap();