Show pairs which are wrong ...
This commit is contained in:
parent
bb9235c715
commit
ed7207d4c8
@ -134,7 +134,12 @@ def _validate_whitelist(conf: Dict[str, Any]) -> None:
|
|||||||
|
|
||||||
if pl.get('method') == 'StaticPairList':
|
if pl.get('method') == 'StaticPairList':
|
||||||
stake = conf['stake_currency']
|
stake = conf['stake_currency']
|
||||||
pairlist = conf['exchange'].get('pair_whitelist')
|
invalid_pairs = []
|
||||||
if not all([p.endswith(f'/{stake}') for p in pairlist]):
|
for pair in conf['exchange'].get('pair_whitelist'):
|
||||||
|
if not pair.endswith(f'/{stake}'):
|
||||||
|
invalid_pairs.append(pair)
|
||||||
|
|
||||||
|
if invalid_pairs:
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f"Stake-currency {stake} not compatible with pair-whitelist.")
|
f"Stake-currency '{stake}' not compatible with pair-whitelist. "
|
||||||
|
f"Please remove the following pairs: {invalid_pairs}")
|
||||||
|
@ -801,7 +801,7 @@ def test_validate_whitelist(default_conf):
|
|||||||
conf = deepcopy(default_conf)
|
conf = deepcopy(default_conf)
|
||||||
conf['stake_currency'] = 'USDT'
|
conf['stake_currency'] = 'USDT'
|
||||||
with pytest.raises(OperationalException,
|
with pytest.raises(OperationalException,
|
||||||
match="Stake-currency USDT not compatible with pair-whitelist."):
|
match=r"Stake-currency 'USDT' not compatible with pair-whitelist.*"):
|
||||||
validate_config_consistency(conf)
|
validate_config_consistency(conf)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user