feat(execution): reconcile timed-out orders safely
This commit is contained in:
@@ -144,7 +144,13 @@ def _wire(broker: KISBroker):
|
||||
instance_key=INSTANCE,
|
||||
)
|
||||
repo.reconcile_universe(INSTANCE, {PORTFOLIO: SYMBOL})
|
||||
execution = ExecutionService(slots, repo, broker, instance_key=INSTANCE)
|
||||
execution = ExecutionService(
|
||||
slots,
|
||||
repo,
|
||||
broker,
|
||||
instance_key=INSTANCE,
|
||||
clock=lambda: VIRTUAL_AT,
|
||||
)
|
||||
decision = intents.submit_buy(
|
||||
BuyIntent(
|
||||
intent_id="virtual-buy-1",
|
||||
@@ -170,7 +176,13 @@ def test_timeout_after_exchange_accept_resolves_without_duplicate_and_survives_r
|
||||
assert len(state.orders) == 1
|
||||
|
||||
state.fill_orders = True
|
||||
restarted = ExecutionService(slots, repo, _broker(server), instance_key=INSTANCE)
|
||||
restarted = ExecutionService(
|
||||
slots,
|
||||
repo,
|
||||
_broker(server),
|
||||
instance_key=INSTANCE,
|
||||
clock=lambda: VIRTUAL_AT,
|
||||
)
|
||||
restarted.reconcile()
|
||||
|
||||
holding = repo.fetch_slot(slot_id)
|
||||
|
||||
Reference in New Issue
Block a user