serialize gateway data (#6314)

This commit is contained in:
Simon Wicky
2026-01-07 11:22:40 +01:00
committed by Jędrzej Stuczyński
parent 2ec8b93fac
commit 99e2798791
3 changed files with 6 additions and 3 deletions
Generated
+1
View File
@@ -6825,6 +6825,7 @@ dependencies = [
"nym-crypto",
"nym-ip-packet-requests",
"nym-sphinx",
"serde",
"tokio-util",
]
+1
View File
@@ -13,6 +13,7 @@ workspace = true
[dependencies]
tokio-util.workspace = true
serde.workspace = true
nym-authenticator-requests = { path = "../authenticator-requests" }
nym-crypto = { path = "../crypto" }
+4 -3
View File
@@ -1,10 +1,11 @@
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use serde::{Deserialize, Serialize};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
use nym_authenticator_requests::AuthenticatorVersion;
use nym_crypto::asymmetric::x25519::PublicKey;
use nym_crypto::asymmetric::x25519::{PublicKey, serde_helpers::bs58_x25519_pubkey};
use nym_ip_packet_requests::IpPair;
use nym_sphinx::addressing::{NodeIdentity, Recipient};
@@ -16,9 +17,9 @@ pub struct NymNode {
pub authenticator_address: Option<Recipient>,
pub version: AuthenticatorVersion,
}
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GatewayData {
#[serde(with = "bs58_x25519_pubkey")]
pub public_key: PublicKey,
pub endpoint: SocketAddr,
pub private_ipv4: Ipv4Addr,