fix: do not use order info after execution

main
Morty Space 3 years ago
parent 2733a0c00e
commit f9ccc182ba
  1. 10
      tests/test_private.py

@ -145,18 +145,12 @@ async def test_account_limit_orders(
async def make_trades(account, exchange, order_ids):
price = await exchange.get_price(cro.pairs.CRO_USDT)
order_id = await account.buy_market(cro.pairs.CRO_USDT, 1)
order = await account.get_order(order_id)
assert order_id == order.id, (order_id, order.id)
assert order.is_filled, (order_id, order.id, order)
order_ids["buy"].append(order.id)
order_ids["buy"].append(order_id)
order_id = await account.sell_market(
cro.pairs.CRO_USDT, int(round_up(1 / price, 0))
)
order = await account.get_order(order_id)
assert order.is_filled
assert order_id == order.id
order_ids["sell"].append(order.id)
order_ids["sell"].append(order_id)
async def listen_orders(account: cro.Account, orders):

Loading…
Cancel
Save