Apply lots of refactoring to the websocket subpackage (fix every mypy error and warning). Add integers.py and decimal.py to bfxapi.utils package. Update requirements.txt and setup.py with new mypy dependencies.

This commit is contained in:
Davide Casale
2022-12-16 18:30:41 +01:00
parent 0e4cbd40a6
commit 0a53ab7f7e
10 changed files with 393 additions and 348 deletions

View File

@@ -1,4 +1,8 @@
from .. exceptions import BfxBaseException
__all__ = [
"BfxWebsocketException",
"ConnectionNotOpen",
"TooManySubscriptions",
"WebsocketAuthenticationRequired",
@@ -7,9 +11,9 @@ __all__ = [
"OutdatedClientVersion"
]
class BfxWebsocketException(Exception):
class BfxWebsocketException(BfxBaseException):
"""
Base class for all exceptions defined in bfxapi/websocket/exceptions.py.
Base class for all custom exceptions in bfxapi/websocket/exceptions.py.
"""
pass
@@ -35,13 +39,6 @@ class WebsocketAuthenticationRequired(BfxWebsocketException):
pass
class InvalidAuthenticationCredentials(BfxWebsocketException):
"""
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
"""
pass
class EventNotSupported(BfxWebsocketException):
"""
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebsocketClient.
@@ -54,4 +51,11 @@ class OutdatedClientVersion(BfxWebsocketException):
This error indicates a mismatch between the client version and the server WSS version.
"""
pass
class InvalidAuthenticationCredentials(BfxWebsocketException):
"""
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
"""
pass