do not use prefix in serialization (#514)

This commit is contained in:
Giacomo Pasini 2023-11-07 15:24:49 +01:00 committed by GitHub
parent 1b4c0638fa
commit ccc85904d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1203,7 +1203,7 @@ mod tests {
eprintln!("{serialized}");
assert_eq!(
serialized,
r#"{"id":"0x0000000000000000000000000000000000000000000000000000000000000000","current_view":1,"highest_voted_view":-1,"local_high_qc":{"view":0,"id":"0x0000000000000000000000000000000000000000000000000000000000000000"},"tip":{"id":"0x0000000000000000000000000000000000000000000000000000000000000000","view":0,"parent_qc":{"Standard":{"view":0,"id":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"leader_proof":{"LeaderId":{"leader_id":"0x0000000000000000000000000000000000000000000000000000000000000000"}}},"last_view_timeout_qc":null,"last_committed_block":{"id":"0x0000000000000000000000000000000000000000000000000000000000000000","view":0,"parent_qc":{"Standard":{"view":0,"id":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"leader_proof":{"LeaderId":{"leader_id":"0x0000000000000000000000000000000000000000000000000000000000000000"}}}}"#
r#"{"id":"0000000000000000000000000000000000000000000000000000000000000000","current_view":1,"highest_voted_view":-1,"local_high_qc":{"view":0,"id":"0000000000000000000000000000000000000000000000000000000000000000"},"tip":{"id":"0000000000000000000000000000000000000000000000000000000000000000","view":0,"parent_qc":{"Standard":{"view":0,"id":"0000000000000000000000000000000000000000000000000000000000000000"}},"leader_proof":{"LeaderId":{"leader_id":"0000000000000000000000000000000000000000000000000000000000000000"}}},"last_view_timeout_qc":null,"last_committed_block":{"id":"0000000000000000000000000000000000000000000000000000000000000000","view":0,"parent_qc":{"Standard":{"view":0,"id":"0000000000000000000000000000000000000000000000000000000000000000"}},"leader_proof":{"LeaderId":{"leader_id":"0000000000000000000000000000000000000000000000000000000000000000"}}}}"#
);
let deserialized: CarnotInfo = serde_json::from_str(&serialized).unwrap();

View File

@ -5,7 +5,7 @@ pub mod serde {
serializer: S,
) -> Result<S::Ok, S::Error> {
use serde::Serialize;
const_hex::const_encode::<N, true>(&src)
const_hex::const_encode::<N, false>(&src)
.as_str()
.serialize(serializer)
}