This commit is contained in:
@@ -37,6 +37,9 @@ func (s System) Recover(ctx context.Context, reconcile reconciliation.Engine) (d
|
||||
case domain.StatePlaceEntryOrders, domain.StateMonitorEntryOrders,
|
||||
domain.StatePlaceExitOrders, domain.StateMonitorExitOrders,
|
||||
domain.StateHoldOvernight:
|
||||
if !s.mode.AllowsBrokerOrders() {
|
||||
return state, nil
|
||||
}
|
||||
diffs, err := reconcile.Run(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -80,7 +80,7 @@ func TestCalendarRecoveryAllowsRestartInsideExitWindow(t *testing.T) {
|
||||
func TestRecoverFromMonitorEntryHaltsOnCriticalReconciliationDiff(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
repo := testutil.NewMemoryRepository()
|
||||
if err := repo.SaveSystemState(ctx, domain.StateMonitorEntryOrders, domain.ModePaper, false, "", "{}"); err != nil {
|
||||
if err := repo.SaveSystemState(ctx, domain.StateMonitorEntryOrders, domain.ModeSandbox, false, "", "{}"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := repo.UpsertOrder(ctx, domain.Order{
|
||||
@@ -97,7 +97,7 @@ func TestRecoverFromMonitorEntryHaltsOnCriticalReconciliationDiff(t *testing.T)
|
||||
}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
system := New(repo, domain.ModePaper)
|
||||
system := New(repo, domain.ModeSandbox)
|
||||
state, err := system.Recover(ctx, reconciliation.New(repo, tinvest.NewFakeGateway(), "account", "hash"))
|
||||
if err == nil {
|
||||
t.Fatal("expected critical reconciliation error")
|
||||
|
||||
Reference in New Issue
Block a user