feat: reuse exchange secrets for exchange credential removal
This commit is contained in:
@@ -54,10 +54,14 @@ def remove_exchange_credentials(exchange_config: ExchangeConfig, dry_run: bool)
|
|||||||
Removes exchange keys from the configuration and specifies dry-run
|
Removes exchange keys from the configuration and specifies dry-run
|
||||||
Used for backtesting / hyperopt and utils.
|
Used for backtesting / hyperopt and utils.
|
||||||
Modifies the input dict!
|
Modifies the input dict!
|
||||||
|
:param exchange_config: Exchange configuration
|
||||||
|
:param dry_run: If True, remove sensitive keys from the exchange configuration
|
||||||
"""
|
"""
|
||||||
if dry_run:
|
if not dry_run:
|
||||||
exchange_config["key"] = ""
|
return
|
||||||
exchange_config["apiKey"] = ""
|
|
||||||
exchange_config["secret"] = ""
|
for key in [k for k in _SENSITIVE_KEYS if k.startswith("exchange.")]:
|
||||||
exchange_config["password"] = ""
|
if "." in key:
|
||||||
exchange_config["uid"] = ""
|
key1 = key.removeprefix("exchange.")
|
||||||
|
if key1 in exchange_config:
|
||||||
|
exchange_config[key1] = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user