channeldb/test: extend payment control test with failed attempt
This commit is contained in:
parent
fa3a762a2c
commit
4c74c0817e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user