Skip to content

Commit

Permalink
lowercase hex node ID (#1016)
Browse files Browse the repository at this point in the history
* lowercase hex node ID

* update changelog for #1016

* Update .changelog/unreleased/bug-fixes/1016-lowercase-node-id.md

Co-authored-by: Thane Thomson <[email protected]>

Co-authored-by: Thane Thomson <[email protected]>
  • Loading branch information
tzemanovic and thanethomson authored Nov 2, 2021
1 parent 60e1a0a commit c75a947
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/unreleased/bug-fixes/1016-lowercase-node-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `[tendermint]` The `tendermint::node::Id` `Display` implementation now prints the hexadecimal string in lowercase ([#971](https://github.com/informalsystems/tendermint-rs/issues/971))
2 changes: 1 addition & 1 deletion config/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ fn node_key_parser() {
let node_key = NodeKey::parse_json(&raw_node_key).unwrap();
assert_eq!(
node_key.node_id().to_string(),
"1A7B6BCF3D6FB055AB3AEBCA415847531B626699"
"1a7b6bcf3d6fb055ab3aebca415847531b626699"
);
}

Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/node/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl ConstantTimeEq for Id {
impl Display for Id {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for byte in &self.0 {
write!(f, "{:02X}", byte)?;
write!(f, "{:02x}", byte)?;
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/test/unit/p2p/secret_connection/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ fn test_secret_connection_pubkey_serialization() {

assert_eq!(
example_key.to_string(),
"117C95C4FD7E636C38D303493302D2C271A39669"
"117c95c4fd7e636c38d303493302d2c271a39669"
);
}

0 comments on commit c75a947

Please sign in to comment.