ethereum / eth-account

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

Change `language` arg to enum in `Mnemonic` #291

Closed DavidRomanovizc closed 2 months ago

DavidRomanovizc commented 2 months ago

What was wrong?

Change the language param in mnemonics to an enum

Related to Issue #287 Closes #287

How was it fixed?

Todo:

Cute Animal Picture

image

pacrob commented 2 months ago

Hey @DavidRomanovizc , we discussed this today and decided we'd like this not to be breaking. Sorry for lack of clarity in the initial issue. Keeping everything you've done, just allow Union[Language, str] in where language is an arg, and keep return types too. If you get to it, awesome, otherwise I'll put it together later this week. Thank you!

DavidRomanovizc commented 2 months ago

@pacrob, maybe adding wanrings.warn if isinstance(language, str) so that users pass it using an enum? And if it will necessary we change type annotations to language: Language in the future update

pacrob commented 2 months ago

Good idea, @DavidRomanovizc, deprecation warnings added. There's some major pypi funkiness going on, so I'll come back and verify CI passing tomorrow.

edit: NM, lookin' good! Needs some review from the team, but otherwise gtg.