Add serde roundtrip tests
We have a TODO in the code to add serde roundtrip unit tests, seems reasonable so do it and remove the TODO.
This commit is contained in:
parent
75949355a4
commit
a8f9e8ad96
|
@ -951,7 +951,13 @@ mod tests {
|
||||||
"script round-trip failed for {}",
|
"script round-trip failed for {}",
|
||||||
addr,
|
addr,
|
||||||
);
|
);
|
||||||
//TODO: add serde roundtrip after no-strason PR
|
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
{
|
||||||
|
let ser = serde_json::to_string(addr).expect("failed to serialize address");
|
||||||
|
let back: Address = serde_json::from_str(&ser).expect("failed to deserialize address");
|
||||||
|
assert_eq!(back, *addr, "serde round-trip failed for {}", addr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue