Rename _refresh_whitelist()

This commit is contained in:
hroff-1902 2020-05-16 11:49:24 +03:00
parent f8b01f5a43
commit facaaabc1e
2 changed files with 6 additions and 5 deletions

View File

@ -84,7 +84,7 @@ class FreqtradeBot:
self.edge = Edge(self.config, self.exchange, self.strategy) if \
self.config.get('edge', {}).get('enabled', False) else None
self.active_pair_whitelist = self._refresh_whitelist()
self.active_pair_whitelist = self._refresh_active_whitelist()
# Set initial bot state from config
initial_state = self.config.get('initial_state')
@ -142,7 +142,7 @@ class FreqtradeBot:
# Query trades from persistence layer
trades = Trade.get_open_trades()
self.active_pair_whitelist = self._refresh_whitelist(trades)
self.active_pair_whitelist = self._refresh_active_whitelist(trades)
# Refreshing candles
self.dataprovider.refresh(self.dataprovider.create_pair_list(self.active_pair_whitelist),
@ -165,9 +165,10 @@ class FreqtradeBot:
Trade.session.flush()
def _refresh_whitelist(self, trades: List[Trade] = []) -> List[str]:
def _refresh_active_whitelist(self, trades: List[Trade] = []) -> List[str]:
"""
Refresh whitelist from pairlist or edge and extend it with trades.
Refresh active whitelist from pairlist or edge and extend it with
pairs that have open trades.
"""
# Refresh whitelist
self.pairlists.refresh_pairlist()

View File

@ -92,7 +92,7 @@ def patch_wallet(mocker, free=999.9) -> None:
def patch_whitelist(mocker, conf) -> None:
mocker.patch('freqtrade.freqtradebot.FreqtradeBot._refresh_whitelist',
mocker.patch('freqtrade.freqtradebot.FreqtradeBot._refresh_active_whitelist',
MagicMock(return_value=conf['exchange']['pair_whitelist']))