node: Use `camelCase` for control socket data

It's easier if we use camel-case everywhere, because some types may be
used on the web as well as on the control socket. This way, all
json-encoded data looks the same.
This commit is contained in:
Alexis Sellier 2023-07-26 13:08:15 +02:00
parent 8a3133e137
commit b953e9f6b5
No known key found for this signature in database
4 changed files with 6 additions and 6 deletions

View File

@ -361,7 +361,7 @@ pub struct Session {
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[serde(rename_all = "camelCase")]
pub struct Seed {
pub nid: NodeId,
pub addrs: Vec<KnownAddress>,
@ -424,7 +424,7 @@ pub enum AnnounceEvent {
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "status", rename_all = "kebab-case")]
#[serde(tag = "status", rename_all = "camelCase")]
pub enum FetchResult {
Success {
updated: Vec<RefUpdate>,

View File

@ -91,7 +91,7 @@ pub struct Node {
/// A known address.
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[serde(rename_all = "camelCase")]
pub struct KnownAddress {
/// Network address.
pub addr: Address,
@ -117,7 +117,7 @@ impl KnownAddress {
/// Address source. Specifies where an address originated from.
#[derive(Debug, Copy, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[serde(rename_all = "camelCase")]
pub enum Source {
/// An address that was shared by another peer.
Peer,

View File

@ -8,7 +8,7 @@ use crate::storage::RefUpdate;
/// A service event.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case", tag = "type")]
#[serde(rename_all = "camelCase", tag = "type")]
pub enum Event {
RefsFetched {
remote: NodeId,

View File

@ -122,7 +122,7 @@ pub type RemoteId = PublicKey;
/// An update to a reference.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
#[serde(rename_all = "camelCase")]
pub enum RefUpdate {
Updated { name: RefString, old: Oid, new: Oid },
Created { name: RefString, oid: Oid },