-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some python type hints for keypair #87
Conversation
@@ -0,0 +1,89 @@ | |||
from typing import Optional, Final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Optional, Final | |
from typing import Optional, Final, TYPE_CHECKING | |
if TYPE_CHECKING: | |
from scalecodec import ScaleBytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this work without scalecodec
in the requirements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this work without
scalecodec
in the requirements?
kind of yes for the build. because TYPE_CHECKING will only work during the call of functions/methods where the annotation is checked.
SDK has scalecodec
in the requirements. It gonna work via SDK.
But (theoretically) if someone wants to install the wallet package independently of SDK or BTCLI and tries to create an instance of the Keypair class, they will get an error when calling the sign
and verify
methods. I would add scalecodec
to the wallet requirements with a version equal to the version in BTCLI and SDK
Addresses part of #86