From fd22f45178fb2000bf00113f744abc32f115e6d0 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 11 Jul 2022 13:00:47 -0400 Subject: [PATCH] Oof, paper engine msg fixes after using `msgspec.Struct`.. --- piker/clearing/_paper_engine.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/piker/clearing/_paper_engine.py b/piker/clearing/_paper_engine.py index 802dcf46..59c05e96 100644 --- a/piker/clearing/_paper_engine.py +++ b/piker/clearing/_paper_engine.py @@ -111,11 +111,12 @@ class PaperBoi: msg = BrokerdStatus( status='submitted', reqid=reqid, - broker=self.broker, time_ns=time.time_ns(), filled=0.0, reason='paper_trigger', remaining=size, + + broker_details={'name': 'paperboi'}, ) await self.ems_trades_stream.send(msg) @@ -168,10 +169,9 @@ class PaperBoi: msg = BrokerdStatus( status='cancelled', - oid=oid, reqid=reqid, - broker=self.broker, time_ns=time.time_ns(), + broker_details={'name': 'paperboi'}, ) await self.ems_trades_stream.send(msg) @@ -229,14 +229,13 @@ class PaperBoi: filled=size, remaining=0 if order_complete else remaining, - action=action, - size=size, - price=price, - broker_details={ 'paper_info': { 'oid': oid, }, + 'action': action, + 'size': size, + 'price': price, 'name': self.broker, }, )