protobuf migration: replace JSON with prost-generated wire format
- Expanded protocol/lnex.proto with full message set for all packet types - Added prost + prost-build to gateway build pipeline - Refactored all handlers and framing to use prost encode/decode - Removed serde payload structs (now generated from .proto) - Server starts and admin endpoint responds
This commit is contained in:
parent
5534cd01f7
commit
9821814240
31 changed files with 719 additions and 661 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use prost::Message;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tracing::{info, warn};
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ pub async fn handle_channel_create(
|
|||
crypto: &SessionCrypto,
|
||||
state: &State,
|
||||
) -> Result<()> {
|
||||
let req: ChannelCreatePayload = serde_json::from_slice(payload)?;
|
||||
let req = ChannelCreatePayload::decode(payload)?;
|
||||
let sess = match session::get(&state.sessions, session_id).await {
|
||||
Some(s) => s,
|
||||
None => return Ok(()),
|
||||
|
|
@ -178,7 +179,7 @@ pub async fn handle_channel_delete(
|
|||
crypto: &SessionCrypto,
|
||||
state: &State,
|
||||
) -> Result<()> {
|
||||
let req: ChannelDeletePayload = serde_json::from_slice(payload)?;
|
||||
let req = ChannelDeletePayload::decode(payload)?;
|
||||
let sess = match session::get(&state.sessions, session_id).await {
|
||||
Some(s) => s,
|
||||
None => return Ok(()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue