channeldb/test: extend payment control test with failed attempt

This commit is contained in:
Joost Jager 2020-02-20 14:56:24 +01:00
parent fa3a762a2c
commit 4c74c0817e
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -116,9 +116,18 @@ func TestPaymentControlSwitchFail(t *testing.T) {
nil,
)
// Record a new attempt.
// Record a new attempt. In this test scenario, the attempt fails.
// However, this is not communicated to control tower in the current
// implementation. It only registers the initiation of the attempt.
attempt.AttemptID = 2
err = pControl.RegisterAttempt(info.PaymentHash, attempt)
if err != nil {
t.Fatalf("unable to register attempt: %v", err)
}
// Record another attempt.
attempt.AttemptID = 3
err = pControl.RegisterAttempt(info.PaymentHash, attempt)
if err != nil {
t.Fatalf("unable to send htlc message: %v", err)
}
@ -128,7 +137,7 @@ func TestPaymentControlSwitchFail(t *testing.T) {
nil,
)
// Verifies that status was changed to StatusSucceeded.
// Settle the attempt and verify that status was changed to StatusSucceeded.
var payment *MPPayment
payment, err = pControl.Success(info.PaymentHash, preimg)
if err != nil {