fix: delegate JsonU256 serialize impl (#1453)

This commit is contained in:
Matthias Seitz
2023-02-20 01:45:25 +01:00
committed by GitHub
parent e8453abc78
commit 3592318399

View File

@ -20,7 +20,7 @@ impl Serialize for JsonU256 {
where
S: Serializer,
{
self.0.to_string().serialize(serializer)
self.0.serialize(serializer)
}
}
@ -111,6 +111,9 @@ mod test {
let data = JsonU256(U256::from(16));
let serialized = serde_json::to_string(&data).unwrap();
assert_eq!(serialized, r#""16""#);
assert_eq!(
serialized,
r#""0x0000000000000000000000000000000000000000000000000000000000000010""#
);
}
}