zksync-sdk / zksync-python

Python 3.8 SDK for zkSync
MIT License
116 stars 64 forks source link

Introduce mypy type checking #17

Closed hukkin closed 2 years ago

hukkin commented 3 years ago

Closes https://github.com/zksync-sdk/zksync-python/issues/13

Fixes the make mypy and tox -e mypy invocations, which used to run unittests, now run mypy. Fixes all mypy errors.

hukkin commented 3 years ago

Hey @Deniallugo is mypy something that you want in this project? I'm asking because it took some time and effort to make it pass initially, and now after the latest changes there are pretty big merge conflicts (and mypy errors after fixing those), which I don't want to get into fixing if this isn't something you want merged.

popzxc commented 3 years ago

My 5 cents is that mypy is pretty important and it's better to have it. The final decision is up to @Deniallugo though.

Deniallugo commented 3 years ago

Sorry, for the big gap. I think, that mypy is really important for this product. So, please use it everywhere

hukkin commented 3 years ago

@Deniallugo :+1: I fixed all the conflicts

vyastrebovvareger commented 2 years ago

I do not know but it looks like the some library interface has been changed/updated.

from eth_account.signers.base import BaseAccount now accepts only SignableMessage type. Let looking for fix

Sorry. Looks strange because of: message = encode_defunct(message.encode()) must be type of SignableMessage

hukkin commented 2 years ago

Fixed the mypy error. It's not a change in the API. It's just that eth_account didn't distribute type data before the latest version so mypy was not as strict here before.

vyastrebovvareger commented 2 years ago

I got the same issue with the test_is_public_key_onset. Currently I can't get the point why it's failed

vyastrebovvareger commented 2 years ago

Locally it's working fine

vyastrebovvareger commented 2 years ago

fail of test_is_public_key_onset occurs randomly but as far as I can see it depends on timeout and execution flow.