Add order_type to buy_notification

This commit is contained in:
Matthias 2019-06-17 06:55:30 +02:00
parent b0c5286e8a
commit 475e76b272
3 changed files with 6 additions and 3 deletions

View File

@ -132,7 +132,7 @@ class Telegram(RPC):
msg['stake_amount_fiat'] = 0
message = ("*{exchange}:* Buying {pair}\n"
"with limit `{limit:.8f}\n"
"at rate `{limit:.8f}\n"
"({stake_amount:.6f} {stake_currency}").format(**msg)
if msg.get('fiat_currency', None):

View File

@ -1188,6 +1188,7 @@ def test_send_msg_buy_notification(default_conf, mocker) -> None:
'exchange': 'Bittrex',
'pair': 'ETH/BTC',
'limit': 1.099e-05,
'order_type': 'limit',
'stake_amount': 0.001,
'stake_amount_fiat': 0.0,
'stake_currency': 'BTC',
@ -1195,7 +1196,7 @@ def test_send_msg_buy_notification(default_conf, mocker) -> None:
})
assert msg_mock.call_args[0][0] \
== '*Bittrex:* Buying ETH/BTC\n' \
'with limit `0.00001099\n' \
'at rate `0.00001099\n' \
'(0.001000 BTC,0.000 USD)`'
@ -1339,6 +1340,7 @@ def test_send_msg_buy_notification_no_fiat(default_conf, mocker) -> None:
'exchange': 'Bittrex',
'pair': 'ETH/BTC',
'limit': 1.099e-05,
'order_type': 'limit',
'stake_amount': 0.001,
'stake_amount_fiat': 0.0,
'stake_currency': 'BTC',
@ -1346,7 +1348,7 @@ def test_send_msg_buy_notification_no_fiat(default_conf, mocker) -> None:
})
assert msg_mock.call_args[0][0] \
== '*Bittrex:* Buying ETH/BTC\n' \
'with limit `0.00001099\n' \
'at rate `0.00001099\n' \
'(0.001000 BTC)`'

View File

@ -126,6 +126,7 @@ def test_exception_send_msg(default_conf, mocker, caplog):
'exchange': 'Bittrex',
'pair': 'ETH/BTC',
'limit': 0.005,
'order_type': 'limit',
'stake_amount': 0.8,
'stake_amount_fiat': 500,
'stake_currency': 'BTC',