Skip to content

Commit

Permalink
python: remove some enums
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed Apr 13, 2022
1 parent bf6dfad commit a4bf6da
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions python/bbgo/enums/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

from enum import Enum

# enum Event {
# UNKNOWN = 0;
# SUBSCRIBED = 1;
# UNSUBSCRIBED = 2;
# SNAPSHOT = 3;
# UPDATE = 4;
# AUTHENTICATED = 5;
# ORDER_SNAPSHOT = 6;
# ORDER_UPDATE = 7;
# TRADE_SNAPSHOT = 8;
# TRADE_UPDATE = 9;
# ACCOUNT_SNAPSHOT = 10;
# ACCOUNT_UPDATE = 11;
# ERROR = 99;
# }
import bbgo_pb2


Expand All @@ -28,12 +13,6 @@ class EventType(Enum):
AUTHENTICATED = 'authenticated'
SNAPSHOT = 'snapshot'
UPDATE = 'update'
ORDER_SNAPSHOT = 'order_snapshot'
ORDER_UPDATE = 'order_update'
TRADE_SNAPSHOT = 'trade_snapshot'
TRADE_UPDATE = 'trade_update'
ACCOUNT_SNAPSHOT = 'account_snapshot'
ACCOUNT_UPDATE = 'account_update'

@classmethod
def from_pb(cls, obj: bbgo_pb2.Event) -> EventType:
Expand All @@ -45,11 +24,5 @@ def from_pb(cls, obj: bbgo_pb2.Event) -> EventType:
bbgo_pb2.Event.AUTHENTICATED: cls.AUTHENTICATED,
bbgo_pb2.Event.SNAPSHOT: cls.SNAPSHOT,
bbgo_pb2.Event.UPDATE: cls.UPDATE,
bbgo_pb2.Event.ORDER_SNAPSHOT: cls.ORDER_SNAPSHOT,
bbgo_pb2.Event.ORDER_UPDATE: cls.ORDER_UPDATE,
bbgo_pb2.Event.TRADE_SNAPSHOT: cls.TRADE_SNAPSHOT,
bbgo_pb2.Event.TRADE_UPDATE: cls.TRADE_UPDATE,
bbgo_pb2.Event.ACCOUNT_SNAPSHOT: cls.ACCOUNT_SNAPSHOT,
bbgo_pb2.Event.ACCOUNT_UPDATE: cls.ACCOUNT_UPDATE,
}
return d[obj]

0 comments on commit a4bf6da

Please sign in to comment.