order_mode: add comment around `Order` being a dict bug

basic_buy_bot
Tyler Goodlet 2023-06-20 14:40:57 -04:00
parent ad31631a8f
commit 6c10c2f623
1 changed files with 8 additions and 4 deletions

View File

@ -1143,13 +1143,17 @@ async def process_trade_msg(
case Status(resp='fill'): case Status(resp='fill'):
# handle out-of-piker fills reporting? # handle out-of-piker fills reporting?
order: Order = client._sent_orders.get(oid) order: Order | None
if not order: if not (order := client._sent_orders.get(oid)):
# set it from last known request msg
log.warning(f'order {oid} is unknown') log.warning(f'order {oid} is unknown')
order = msg.req order = msg.req
action = order.action # XXX TODO: have seen order be a dict here!?
details = msg.brokerd_msg # that should never happen tho?
action: str = order.action
details: dict = msg.brokerd_msg
# TODO: state tracking: # TODO: state tracking:
# - put the actual exchange timestamp? # - put the actual exchange timestamp?