fix: add_key 允许突破触价开仓类型通过白名单校验
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7881,7 +7881,7 @@ def add_key():
|
|||||||
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
||||||
+ tuple(FIB_KEY_MONITOR_TYPES)
|
+ tuple(FIB_KEY_MONITOR_TYPES)
|
||||||
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
||||||
+ (TRIGGER_ENTRY_MONITOR_TYPE,)
|
+ tuple(TRIGGER_ENTRY_MONITOR_TYPES)
|
||||||
)
|
)
|
||||||
if mt not in allowed_types:
|
if mt not in allowed_types:
|
||||||
flash("监控类型无效")
|
flash("监控类型无效")
|
||||||
|
|||||||
@@ -7781,7 +7781,7 @@ def add_key():
|
|||||||
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
||||||
+ tuple(FIB_KEY_MONITOR_TYPES)
|
+ tuple(FIB_KEY_MONITOR_TYPES)
|
||||||
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
||||||
+ (TRIGGER_ENTRY_MONITOR_TYPE,)
|
+ tuple(TRIGGER_ENTRY_MONITOR_TYPES)
|
||||||
)
|
)
|
||||||
if mt not in allowed_types:
|
if mt not in allowed_types:
|
||||||
flash("监控类型无效")
|
flash("监控类型无效")
|
||||||
|
|||||||
@@ -7777,7 +7777,7 @@ def add_key():
|
|||||||
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
||||||
+ tuple(FIB_KEY_MONITOR_TYPES)
|
+ tuple(FIB_KEY_MONITOR_TYPES)
|
||||||
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
||||||
+ (TRIGGER_ENTRY_MONITOR_TYPE,)
|
+ tuple(TRIGGER_ENTRY_MONITOR_TYPES)
|
||||||
)
|
)
|
||||||
if mt not in allowed_types:
|
if mt not in allowed_types:
|
||||||
flash("监控类型无效")
|
flash("监控类型无效")
|
||||||
|
|||||||
@@ -7331,7 +7331,7 @@ def add_key():
|
|||||||
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
+ tuple(KEY_MONITOR_ALERT_ONLY_TYPES)
|
||||||
+ tuple(FIB_KEY_MONITOR_TYPES)
|
+ tuple(FIB_KEY_MONITOR_TYPES)
|
||||||
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
+ (FALSE_BREAKOUT_MONITOR_TYPE,)
|
||||||
+ (TRIGGER_ENTRY_MONITOR_TYPE,)
|
+ tuple(TRIGGER_ENTRY_MONITOR_TYPES)
|
||||||
)
|
)
|
||||||
if mt not in allowed_types:
|
if mt not in allowed_types:
|
||||||
flash("监控类型无效")
|
flash("监控类型无效")
|
||||||
|
|||||||
@@ -81,4 +81,5 @@ def test_type_names():
|
|||||||
assert is_trigger_entry_key_monitor_type(LEGACY_TRIGGER_ENTRY_MONITOR_TYPE)
|
assert is_trigger_entry_key_monitor_type(LEGACY_TRIGGER_ENTRY_MONITOR_TYPE)
|
||||||
assert is_breakout_trigger_entry_key_monitor_type(BREAKOUT_TRIGGER_ENTRY_MONITOR_TYPE)
|
assert is_breakout_trigger_entry_key_monitor_type(BREAKOUT_TRIGGER_ENTRY_MONITOR_TYPE)
|
||||||
assert CALLBACK_TRIGGER_ENTRY_MONITOR_TYPE in TRIGGER_ENTRY_MONITOR_TYPES
|
assert CALLBACK_TRIGGER_ENTRY_MONITOR_TYPE in TRIGGER_ENTRY_MONITOR_TYPES
|
||||||
|
assert BREAKOUT_TRIGGER_ENTRY_MONITOR_TYPE in TRIGGER_ENTRY_MONITOR_TYPES
|
||||||
assert TRIGGER_ENTRY_VALIDITY_HOURS == 24
|
assert TRIGGER_ENTRY_VALIDITY_HOURS == 24
|
||||||
|
|||||||
Reference in New Issue
Block a user