prior pairlists should go first

This commit is contained in:
Matthias 2022-09-25 19:32:39 +02:00
parent bd106b4b8e
commit af59572cb9
2 changed files with 14 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class ProducerPairList(IPairList):
if pairlist is None:
pairlist = self._pairlistmanager._dataprovider.get_producer_pairs(self._producer_name)
pairs = list(dict.fromkeys(upstream_pairlist + pairlist))
pairs = list(dict.fromkeys(pairlist + upstream_pairlist))
if self._num_assets:
pairs = pairs[:self._num_assets]

View File

@ -1413,3 +1413,16 @@ def test_ProducerPairlist(mocker, whitelist_conf, markets):
# Pairlist reduced to 2
assert pm.whitelist == pairs[:2]
assert len(pm.whitelist) == 2
whitelist_conf['exchange']['pair_whitelist'] = ['TKN/BTC']
whitelist_conf['pairlists'] = [
{"method": "StaticPairList"},
{
"method": "ProducerPairList",
"producer_name": "hello_world",
}
]
pm = PairListManager(exchange, whitelist_conf, dp)
pm.refresh_pairlist()
assert len(pm.whitelist) == 4
assert pm.whitelist == ['TKN/BTC'] + pairs