Closed danwallach closed 4 years ago
When writing issues, there needs to be a singular issue being addressed. The description of this issue lists one problem where the title lists the overarching issue.
Also there was an existing issue on this fact so this collides with existing issue #120 . This includes these problems as the Core class is the Ballot and all the underlying information underneath that particular class. I've reopened this and I'll edit this description to be more accurate.
The problem started with ProofUsage
, then as I tried to fix it the problem ballooned into a larger problem with serialization as I investigated.
Here's the code to deserialize a ProofUsage enum:
You can't just use
ProofUsage[usage_string]
. That crashes, as below:You need to convert from the string (“Prove knowledge of secret value”) back to the name of the enum (“SecretValue”) before you can do the lookup like this.
To try to catch these and other issues, I wrote a new Hypothesis unit test in
test_serialization.py
and found several other issues along these lines, where deserialization was not the inverse of serialization.