moved fill_leverage_brackets and get_max_leverage to base exchange class, wrote parse_leverage_tier and load_leverage_brackets

This commit is contained in:
Sam Germain
2022-02-07 01:33:42 -06:00
parent a99cf2eeed
commit 6b9915bc73
4 changed files with 145 additions and 146 deletions

View File

@@ -3561,8 +3561,10 @@ def test__ccxt_config(
("TKN/USDT", 210.30, 1.0),
])
def test_get_max_leverage(default_conf, mocker, pair, nominal_value, max_lev):
# Binance has a different method of getting the max leverage
exchange = get_patched_exchange(mocker, default_conf, id="kraken")
default_conf['trading_mode'] = 'futures'
default_conf['margin_mode'] = 'isolated'
exchange = get_patched_exchange(mocker, default_conf, id="gateio")
exchange._api.has['fetchLeverageTiers'] = False
assert exchange.get_max_leverage(pair, nominal_value) == max_lev