ethereum / eth-account

Account abstraction library for web3.py
http://eth-account.readthedocs.io/
MIT License
275 stars 159 forks source link

Don't trigger HDAccount DeprecationWarning if Language enum is passed in #302

Closed kclowes closed 2 months ago

kclowes commented 2 months ago

What was wrong?

We made the language that gets passed into the HD Accounts an Enum, and deprecated passing the string representation in. However, the DeprecationWarning was getting raised even though an Enum got passed.

How was it fixed?

Removed extraneous DeprecationWarnings, and changed the return value of detect_language because I didn't see it documented anywhere, and therefore I am assuming it was meant to be a private method. Also added a new list_languages_enum method. Could stand to come up with a better name for that method, if you have any ideas. Additionally, added a few tests.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

kclowes commented 2 months ago

Just to note, I'm not able to reproduce the DeprecationWarning using the enum on current main. How did you get it to show?

In your terminal: $ export PYTHONWARNINGS=always

and you should see it

pacrob commented 2 months ago

and you should see it

Still doesn't show for me, but no reason to hold this up. It's still an improvement over existing!