单笔期权默认改为币本位;未配置时按coin处理

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 14:05:44 +08:00
parent 6c49c7d51c
commit 4fb3be35ef
14 changed files with 34 additions and 25 deletions
+4
View File
@@ -13,6 +13,10 @@ class TestOptionsMarginMode(unittest.TestCase):
self.assertEqual(normalize_options_margin_mode("usdc"), "usdc")
self.assertEqual(normalize_options_margin_mode("coin"), "coin")
self.assertEqual(normalize_options_margin_mode("币本位"), "coin")
with patch.dict(os.environ, {}, clear=False):
os.environ.pop("OKX_OPTIONS_MARGIN_MODE", None)
self.assertEqual(normalize_options_margin_mode(None), "coin")
self.assertEqual(normalize_options_margin_mode(""), "coin")
def test_inst_family(self):
from lib.options.options_margin_mode_lib import inst_family_for_underlying