approval: the gate reads no held-back ask (the operator channel offers every ask)

Builds: design 47 H §764 (The operator channel's limit), H-A-57
This commit is contained in:
2026-11-20 02:31:54 +01:00
parent 59a73e72c0
commit bd2db73c3b
4 changed files with 16 additions and 5 deletions
+11
View File
@@ -352,6 +352,17 @@ func TestAHolderHoldsAMarkedCall(t *testing.T) {
t.Fatalf("again: %+v, %v", answer, err)
}
})
t.Run("an ask in the old state held-back is no open ask: the call asks again (ADR 0682 section 14)", func(t *testing.T) {
w := setup()
_, h, _ := hold(t, w, call("n1.a", `{}`), true)
w.router.mu.Lock()
w.router.records[h.Asked] = &Record{State: "held-back"}
w.router.mu.Unlock()
_, h2, err := hold(t, w, call("n1.a", `{}`), false)
if err == nil || h2 != nil || strings.Contains(err.Error(), "still waiting") || len(w.router.asks) != 2 {
t.Errorf("the call: %v, %d asks, want it asked again", err, len(w.router.asks))
}
})
t.Run("a restart between the ask and the Approve runs the waiting call once", func(t *testing.T) {
w := setup()
_, h, _ := hold(t, w, call("n1.a", `{}`), true)