Include hash_tree_root in the SSZ fuzzing tests

This commit is contained in:
Zahary Karadjov 2020-06-03 14:59:50 +03:00 committed by zah
parent 2acda1c115
commit 37b4739547
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,9 @@ template sszFuzzingTest*(T: type) =
let reEncoded = SSZ.encode(decoded)
when T isnot SignedBeaconBlock:
let hash = hash_tree_root(decoded)
if payload != reEncoded:
when hasSerializationTracing:
# Run deserialization again to produce a seriazation trace
@ -30,6 +33,9 @@ template sszFuzzingTest*(T: type) =
echo "Re-encoided payload with len = ", reEncoded.len
echo reEncoded
when T isnot SignedBeaconBlock:
echo "HTR: ", hash
echo repr(decoded)
doAssert false