core-lightning/contrib/pyln-grpc-proto
Erik De Smedt eea9c8253b msggen: Choose better when a subfield is optional
**Problem Description**

In previous commits I introduced some new fields to `msggen`.
One example is `CustomMsgResponse` in `cln-grpc/src/notification.rs`.

```rust
pub struct CustomMsgResponse {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub peer_id: Option<PublicKey>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payload: Option<String>,
}
```

The `peer_id` and `payload` are required parameters.
However, the generated code is still marking them as `Optional`.

This is a choice made by `msggen`. It does this because `payload` and
`peer_id` are recently added fields. By marking the field as optional
the language bindings would also work when used on an older version of
Core-Lightning.

In this scenario. Marking them as optional is overkill.
The `CustomMsgStruct` and `payload` field are created in the same
version of CoreLightning.

This commit solves this behavior.
2024-05-16 14:00:18 +02:00
..
pyln/grpc msggen: Choose better when a subfield is optional 2024-05-16 14:00:18 +02:00
Makefile pyln: Also generate type stubs in pyln-grpc-proto 2023-12-15 10:01:57 +10:30
poetry.lock pyln: Also generate type stubs in pyln-grpc-proto 2023-12-15 10:01:57 +10:30
pyproject.toml py: Publish pyln-grpc-proto following new methods 2024-01-16 19:47:50 +01:00
README.md pyln: Create a dedicated pyln-grpc-proto package 2023-07-10 13:47:38 +09:30

pyln-grpc-proto

The python protobuf library is rather restrictive when it comes to importing them multiple times. So this package just contains the compiled protobuf files and serves as the canonical place to load them from.