66
77class StratumAutolykosv2 (Stratum ):
88
9- def __init__ (self ):
10- super (StratumAutolykosv2 , self ).__init__ ()
11-
129 def on_message (self , sock , data : dict ):
1310 if 'method' in data :
1411 self .__on_method (sock , data )
1512 else :
1613 self .__on_response (sock , data )
1714
18- def __on_response (self , sock , data : dict ):
15+ def __on_response (self , _sock , data : dict ):
1916 logging .info (f'response => { data } ' )
2017
2118 def __on_method (self , sock , data : dict ):
@@ -36,7 +33,7 @@ def __on_mining_subscribe(self, sock, request_id: Union[int, str]):
3633 size = 6
3734
3835 key_id = f'"id":{ request_id } '
39- if type (request_id ) is str :
36+ if isinstance (request_id , str ) :
4037 key_id = f'"id":"{ request_id } "'
4138
4239 body = '{' \
@@ -48,7 +45,7 @@ def __on_mining_subscribe(self, sock, request_id: Union[int, str]):
4845
4946 def __on_mining_authorize (self , sock , request_id : Union [int , str ]):
5047 key_id = f'"id":{ request_id } '
51- if type (request_id ) is str :
48+ if isinstance (request_id , str ) :
5249 key_id = f'"id":"{ request_id } "'
5350
5451 body = '{' \
@@ -84,7 +81,7 @@ def __on_mining_authorize(self, sock, request_id: Union[int, str]):
8481
8582 def __on_mining_submit (self , sock , request_id : Union [int , str ], params : list ):
8683 key_id = request_id
87- if type (request_id ) is str :
84+ if isinstance (request_id , str ) :
8885 key_id = f'"{ request_id } "'
8986
9087 logging .info (f'Nonce: { params } ' )
0 commit comments