Pass account names on wire: brokerd => emsd

fsp_feeds
Tyler Goodlet 2021-09-13 08:21:09 -04:00
parent 16b7456fef
commit eb70baf161
1 changed files with 6 additions and 1 deletions

View File

@ -1333,7 +1333,10 @@ async def stream_quotes(
# last = time.time() # last = time.time()
def pack_position(pos: Position) -> dict[str, Any]: def pack_position(
pos: Position
) -> dict[str, Any]:
con = pos.contract con = pos.contract
if isinstance(con, Option): if isinstance(con, Option):
@ -1480,6 +1483,7 @@ async def trades_dialogue(
for client in _client_cache.values(): for client in _client_cache.values():
for pos in client.positions(): for pos in client.positions():
msg = pack_position(pos) msg = pack_position(pos)
msg.account = accounts_def.inverse[msg.account]
all_positions.append(msg.dict()) all_positions.append(msg.dict())
await ctx.started(all_positions) await ctx.started(all_positions)
@ -1636,6 +1640,7 @@ async def deliver_trade_events(
elif event_name == 'position': elif event_name == 'position':
msg = pack_position(item) msg = pack_position(item)
msg.account = accounts_def.inverse[msg.account]
if getattr(msg, 'reqid', 0) < -1: if getattr(msg, 'reqid', 0) < -1: