File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/frequenz/client/electricity_trading Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2002,16 +2002,20 @@ def from_pb(
20022002 Returns:
20032003 PublicOrder object corresponding to the protobuf message.
20042004 """
2005+ execution_option = (
2006+ OrderExecutionOption .from_pb (public_order .execution_option )
2007+ if public_order .HasField ("execution_option" )
2008+ else None
2009+ )
2010+
20052011 return cls (
20062012 public_order_id = public_order .id ,
20072013 delivery_area = DeliveryArea .from_pb (public_order .delivery_area ),
20082014 delivery_period = DeliveryPeriod .from_pb (public_order .delivery_period ),
20092015 side = MarketSide .from_pb (public_order .side ),
20102016 price = Price .from_pb (public_order .price ),
20112017 quantity = Power .from_pb (public_order .quantity ),
2012- execution_option = OrderExecutionOption .from_pb (
2013- public_order .execution_option
2014- ),
2018+ execution_option = execution_option ,
20152019 create_time = public_order .create_time .ToDatetime (tzinfo = timezone .utc ),
20162020 update_time = public_order .update_time .ToDatetime (tzinfo = timezone .utc ),
20172021 )
You can’t perform that action at this time.
0 commit comments