Remove .get calls for dry_run - it's a mandatory property

This commit is contained in:
Matthias
2020-01-20 20:24:40 +01:00
parent 2f82122fc4
commit 1bf475fa1a
4 changed files with 7 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ class RPC:
"""
config = self._freqtrade.config
val = {
'dry_run': config.get('dry_run', False),
'dry_run': config['dry_run'],
'stake_currency': config['stake_currency'],
'stake_amount': config['stake_amount'],
'minimal_roi': config['minimal_roi'].copy(),
@@ -337,7 +337,7 @@ class RPC:
'stake': stake_currency,
})
if total == 0.0:
if self._freqtrade.config.get('dry_run', False):
if self._freqtrade.config['dry_run']:
raise RPCException('Running in Dry Run, balances are not available.')
else:
raise RPCException('All balances are zero.')
@@ -351,7 +351,7 @@ class RPC:
'symbol': symbol,
'value': value,
'stake': stake_currency,
'note': 'Simulated balances' if self._freqtrade.config.get('dry_run', False) else ''
'note': 'Simulated balances' if self._freqtrade.config['dry_run'] else ''
}
def _rpc_start(self) -> Dict[str, str]:

View File

@@ -62,7 +62,7 @@ class RPCManager:
logger.error(f"Message type {msg['type']} not implemented by handler {mod.name}.")
def startup_messages(self, config, pairlist) -> None:
if config.get('dry_run', False):
if config['dry_run']:
self.send_msg({
'type': RPCMessageType.WARNING_NOTIFICATION,
'status': 'Dry run is enabled. All trades are simulated.'