Rename get_positions to fetch_positions to align with ccxt naming
This commit is contained in:
parent
62c42a73e2
commit
9901decf0d
@ -1168,7 +1168,7 @@ class Exchange:
|
|||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
@retrier
|
@retrier
|
||||||
def get_positions(self) -> List[Dict]:
|
def fetch_positions(self) -> List[Dict]:
|
||||||
if self._config['dry_run'] or self.trading_mode != TradingMode.FUTURES:
|
if self._config['dry_run'] or self.trading_mode != TradingMode.FUTURES:
|
||||||
return []
|
return []
|
||||||
try:
|
try:
|
||||||
|
@ -141,7 +141,7 @@ class Wallets:
|
|||||||
if currency not in balances:
|
if currency not in balances:
|
||||||
del self._wallets[currency]
|
del self._wallets[currency]
|
||||||
|
|
||||||
positions = self._exchange.get_positions()
|
positions = self._exchange.fetch_positions()
|
||||||
self._positions = {}
|
self._positions = {}
|
||||||
for position in positions:
|
for position in positions:
|
||||||
symbol = position['symbol']
|
symbol = position['symbol']
|
||||||
|
@ -638,7 +638,7 @@ def test_rpc_balance_handle(default_conf, mocker, tickers):
|
|||||||
'freqtrade.exchange.Exchange',
|
'freqtrade.exchange.Exchange',
|
||||||
validate_trading_mode_and_margin_mode=MagicMock(),
|
validate_trading_mode_and_margin_mode=MagicMock(),
|
||||||
get_balances=MagicMock(return_value=mock_balance),
|
get_balances=MagicMock(return_value=mock_balance),
|
||||||
get_positions=MagicMock(return_value=mock_pos),
|
fetch_positions=MagicMock(return_value=mock_pos),
|
||||||
get_tickers=tickers,
|
get_tickers=tickers,
|
||||||
get_valid_pair_combination=MagicMock(
|
get_valid_pair_combination=MagicMock(
|
||||||
side_effect=lambda a, b: f"{b}/{a}" if a == "USDT" else f"{a}/{b}")
|
side_effect=lambda a, b: f"{b}/{a}" if a == "USDT" else f"{a}/{b}")
|
||||||
|
@ -318,7 +318,7 @@ def test_sync_wallet_futures_live(mocker, default_conf):
|
|||||||
"total": 1000
|
"total": 1000
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
get_positions=MagicMock(return_value=mock_result)
|
fetch_positions=MagicMock(return_value=mock_result)
|
||||||
)
|
)
|
||||||
|
|
||||||
freqtrade = get_patched_freqtradebot(mocker, default_conf)
|
freqtrade = get_patched_freqtradebot(mocker, default_conf)
|
||||||
|
Loading…
Reference in New Issue
Block a user