Use json_load to load leverage tiers

This commit is contained in:
Matthias 2022-09-19 07:23:26 +02:00
parent 1d0e686cd4
commit 4a0a0c307c

View File

@ -1,5 +1,4 @@
""" Binance exchange subclass """ """ Binance exchange subclass """
import json
import logging import logging
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
@ -12,7 +11,7 @@ from freqtrade.enums import CandleType, MarginMode, TradingMode
from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError
from freqtrade.exchange import Exchange from freqtrade.exchange import Exchange
from freqtrade.exchange.common import retrier from freqtrade.exchange.common import retrier
from freqtrade.misc import deep_merge_dicts from freqtrade.misc import deep_merge_dicts, json_load
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -200,7 +199,7 @@ class Binance(Exchange):
Path(__file__).parent / 'binance_leverage_tiers.json' Path(__file__).parent / 'binance_leverage_tiers.json'
) )
with open(leverage_tiers_path) as json_file: with open(leverage_tiers_path) as json_file:
return json.load(json_file) return json_load(json_file)
else: else:
try: try:
return self._api.fetch_leverage_tiers() return self._api.fetch_leverage_tiers()