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'):
# handle out-of-piker fills reporting?
order: Order = client._sent_orders.get(oid)
if not order:
order: Order | None
if not (order := client._sent_orders.get(oid)):
# set it from last known request msg
log.warning(f'order {oid} is unknown')
order = msg.req
action = order.action
details = msg.brokerd_msg
# XXX TODO: have seen order be a dict here!?
# that should never happen tho?
action: str = order.action
details: dict = msg.brokerd_msg
# TODO: state tracking:
# - put the actual exchange timestamp?