add support for all types to watch_list + improve error

This commit is contained in:
Saleh Mir
2022-02-10 08:39:12 +01:00
parent deae30482c
commit b2a9191b30
3 changed files with 10 additions and 2 deletions

View File

@@ -166,6 +166,14 @@ def watch_list() -> List[List[Union[str, str]]]:
watch_list_array = strategy.watch_list()
# loop through the watch list and convert each item into a string
for index, value in enumerate(watch_list_array):
# if value is not a tuple with two values in it, raise ValueError
if not isinstance(value, tuple) or len(value) != 2:
raise ValueError("watch_list() must return a list of tuples with 2 values in each. Example: [(key1, value1), (key2, value2)]")
watch_list_array[index] = (str(value[0]), str(value[1]))
return watch_list_array if len(watch_list_array) else []

View File

@@ -1 +1 @@
__version__ = '0.32.9'
__version__ = '0.32.10'

View File

@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
# also change in version.py
VERSION = '0.32.9'
VERSION = '0.32.10'
DESCRIPTION = "A trading framework for cryptocurrencies"
REQUIRED_PACKAGES = [