diff --git a/tendermint/src/rpc/id.rs b/tendermint/src/rpc/id.rs index 0e0f6f471..9d94d496f 100644 --- a/tendermint/src/rpc/id.rs +++ b/tendermint/src/rpc/id.rs @@ -29,3 +29,27 @@ impl Id { Id::Str(uuid.to_string()) } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::test::test_serialization_roundtrip; + + #[test] + fn round_tripping_jsonrpc_id() { + let str = r#""42""#; + test_serialization_roundtrip::(str); + + let str2 = r#""936DA01F-9ABD-4D9D-80C7-02AF85C822A8""#; + test_serialization_roundtrip::(str2); + + let num = r#"42"#; + test_serialization_roundtrip::(num); + + let zero = r#"0"#; + test_serialization_roundtrip::(zero); + + let null = r#"null"#; + test_serialization_roundtrip::(null); + } +}