fix typo and get rid of pprint of ws stream

kraken_orders
Konstantine Tsafatinos 2022-03-01 15:38:20 -05:00
parent a3345dbba2
commit 617bf3e0da
1 changed files with 2 additions and 3 deletions

View File

@ -271,7 +271,7 @@ class Client:
# for speed # for speed
elif data['ofs'] == 50: elif data['ofs'] == 50:
trades = dict(trades, **resp['result']['trades']) trades = dict(trades, **resp['result']['trades'])
# catch the of the trades # catch the end of the trades
elif resp['result']['trades'] == {}: elif resp['result']['trades'] == {}:
count = resp['result']['count'] count = resp['result']['count']
break break
@ -454,6 +454,7 @@ class Client:
raise SymbolNotFound(json['error'][0] + f': {symbol}') raise SymbolNotFound(json['error'][0] + f': {symbol}')
@asynccontextmanager @asynccontextmanager
async def get_client() -> Client: async def get_client() -> Client:
client = Client() client = Client()
@ -703,9 +704,7 @@ async def trades_dialogue(
fixture=subscribe, fixture=subscribe,
token=token, token=token,
) as ws: ) as ws:
from pprint import pprint
async for msg in process_trade_msgs(ws): async for msg in process_trade_msgs(ws):
pprint(msg)
for trade in msg: for trade in msg:
# check the type of packaged message # check the type of packaged message
assert type(trade) == Trade assert type(trade) == Trade