From a4b8fb2d6b026e701b2c08252f82c65061aefbdf Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 15 Jun 2023 14:32:51 -0400 Subject: [PATCH] Woops, drop paper mode detection on client side.. --- piker/clearing/_client.py | 8 -------- piker/clearing/_ems.py | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/piker/clearing/_client.py b/piker/clearing/_client.py index f5e2a5e3..436b4f8e 100644 --- a/piker/clearing/_client.py +++ b/piker/clearing/_client.py @@ -37,7 +37,6 @@ from ._messages import ( Cancel, BrokerdPosition, ) -from ..brokers import get_brokermod if TYPE_CHECKING: from ._messages import ( @@ -246,13 +245,6 @@ async def open_ems( loglevel=loglevel, ) as portal: - mod = get_brokermod(broker) - if ( - not getattr(mod, 'trades_dialogue', None) - or mode == 'paper' - ): - mode = 'paper' - from ._ems import _emsd_main async with ( # connect to emsd diff --git a/piker/clearing/_ems.py b/piker/clearing/_ems.py index 151e10c8..68639ae8 100644 --- a/piker/clearing/_ems.py +++ b/piker/clearing/_ems.py @@ -353,7 +353,6 @@ async def open_brokerd_dialog( # a paper-simulator clearing engine. # load the paper trading engine - exec_mode = 'paper' log.info(f'{broker}: Entering `paper` trading mode') # load the paper trading engine as a subactor of this emsd @@ -370,11 +369,12 @@ async def open_brokerd_dialog( loglevel=loglevel, ) - # TODO: ideally choose only one of these ep names.. + # take the first supported ep we detect + # on the backend mod. trades_endpoint: Callable for ep_name in [ - 'trades_dialogue', # legacy 'open_trade_dialog', # probably final name? + 'trades_dialogue', # legacy ]: trades_endpoint = getattr( brokermod,