feat条件单新建按标的过滤匹配币种的客户端。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-13 19:18:52 +08:00
parent 18d195849c
commit e2a28e6c94
4 changed files with 140 additions and 27 deletions
+24
View File
@@ -46,6 +46,30 @@ class TestCondCandidatesFunds(unittest.TestCase):
self.assertFalse(out[1]["selectable"])
self.assertIsNone(out[1]["trading_usdt"])
self.assertTrue(out[1]["transfer_blocked"])
self.assertEqual(out[0]["allowed_underlys"], ["ETH", "BTC"])
def test_candidates_carry_allowed_underlys(self):
from lib.cond_orders_cache_lib import _candidates_from_snaps
rows = [
{
"id": 3,
"name": "eth-only",
"online": True,
"error": "",
"snapshot": {
"positions_brief": [],
"cond_order_locked": False,
"instance": {"mode": "sim", "underly": "ETH", "allowed_underlys": ["ETH"]},
"options_allowed_underlys": ["ETH"],
"options_underly": "ETH",
"funds": {"trading_usdt": 1.0, "funding_usdt": 2.0},
},
}
]
out = _candidates_from_snaps(rows)
self.assertEqual(out[0]["allowed_underlys"], ["ETH"])
self.assertEqual(out[0]["default_underly"], "ETH")
def test_open_url_tab_appended(self):
from lib.sso_lib import build_embed_open_url