Error prone parsing of bool
in encode_typed_data/encoding_and_hashing.py:encode_field
#303
Labels
bool
in encode_typed_data/encoding_and_hashing.py:encode_field
#303
What happened?
The
encode_data
method which is the underlying method for EIP712 encoding usesencode_field
to encode its fields into the underlying python type. In the case ofbool
it just uses the pythonbool
method to convert values to booleans, this however leads to very counterintuitive results, with strings like"False"
,"false"
, or"0"
all getting parsed toTrue
Code that produced the error
Full error output
No response
Fill this section in if you know how this could or should be fixed
"false"
/"False"
eth-account Version
0.13.4
Python Version
3.12.4
Operating System
osx
Output from
pip freeze
The text was updated successfully, but these errors were encountered: