Skip to content

Commit

Permalink
fix: use squad ID instead of spaced formatted name in coinbase extra (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrichard authored Sep 25, 2024
1 parent a481bd7 commit 3c701cb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/server/p2p/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Squad {
}

pub fn as_string(&self) -> String {
self.inner.to_case(Case::Lower)
self.inner.clone()
}
}

Expand Down Expand Up @@ -1175,3 +1175,20 @@ where S: ShareChain
self.network_peer_store.clone()
}
}

#[cfg(test)]
mod test {
use super::*;

#[test]
fn squad_as_string_no_spaces_no_underscores() {
let squad = Squad::from("default".to_string());
assert_eq!(squad.as_string(), "default");
}

#[test]
fn squad_as_string_with_spaces_with_underscores() {
let squad = Squad::from("default 2".to_string());
assert_eq!(squad.as_string(), "default_2");
}
}

0 comments on commit 3c701cb

Please sign in to comment.