fix code review from @garcq
This commit is contained in:
parent
3d59abf93e
commit
c9b62cf19f
@ -29,8 +29,8 @@ _CONF = {}
|
|||||||
def refresh_whitelist(whitelist: List[str]) -> List[str]:
|
def refresh_whitelist(whitelist: List[str]) -> List[str]:
|
||||||
"""
|
"""
|
||||||
Check wallet health and remove pair from whitelist if necessary
|
Check wallet health and remove pair from whitelist if necessary
|
||||||
:param whitelist: a new whitelist (optional)
|
:param whitelist: the pair the user might want to trade
|
||||||
:return: None
|
:return: the list of pairs the user wants to trade without the one unavailable or black_listed
|
||||||
"""
|
"""
|
||||||
sanitized_whitelist = []
|
sanitized_whitelist = []
|
||||||
health = exchange.get_wallet_health()
|
health = exchange.get_wallet_health()
|
||||||
@ -52,7 +52,7 @@ def _process(nb_assets: Optional[int] = 0) -> bool:
|
|||||||
"""
|
"""
|
||||||
Queries the persistence layer for open trades and handles them,
|
Queries the persistence layer for open trades and handles them,
|
||||||
otherwise a new trade is created.
|
otherwise a new trade is created.
|
||||||
:param: dynamic_whitelist: True is a dynamic whitelist should be generated (optional)
|
:param: nb_assets: the maximum number of pairs to be traded at the same time
|
||||||
:return: True if a trade has been created or closed, False otherwise
|
:return: True if a trade has been created or closed, False otherwise
|
||||||
"""
|
"""
|
||||||
state_changed = False
|
state_changed = False
|
||||||
|
@ -49,8 +49,6 @@ def test_refresh_whitelist(mocker):
|
|||||||
mocker.patch.multiple('freqtrade.main.exchange',
|
mocker.patch.multiple('freqtrade.main.exchange',
|
||||||
get_wallet_health=get_health)
|
get_wallet_health=get_health)
|
||||||
refreshedwhitelist = refresh_whitelist(conf['exchange']['pair_whitelist'])
|
refreshedwhitelist = refresh_whitelist(conf['exchange']['pair_whitelist'])
|
||||||
print(conf['exchange']['pair_whitelist'])
|
|
||||||
print(refreshedwhitelist)
|
|
||||||
whitelist = ['BTC_ETH', 'BTC_TKN']
|
whitelist = ['BTC_ETH', 'BTC_TKN']
|
||||||
# Ensure all except those in whitelist are removed
|
# Ensure all except those in whitelist are removed
|
||||||
assert_list_equal(whitelist, refreshedwhitelist)
|
assert_list_equal(whitelist, refreshedwhitelist)
|
||||||
|
Loading…
Reference in New Issue
Block a user