mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 19:16:56 +01:00
channeldb/test: extend payment control test with failed attempt
This commit is contained in:
parent
fa3a762a2c
commit
4c74c0817e
1 changed files with 11 additions and 2 deletions
|
@ -116,9 +116,18 @@ func TestPaymentControlSwitchFail(t *testing.T) {
|
||||||
nil,
|
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
|
attempt.AttemptID = 2
|
||||||
err = pControl.RegisterAttempt(info.PaymentHash, attempt)
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("unable to send htlc message: %v", err)
|
t.Fatalf("unable to send htlc message: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -128,7 +137,7 @@ func TestPaymentControlSwitchFail(t *testing.T) {
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Verifies that status was changed to StatusSucceeded.
|
// Settle the attempt and verify that status was changed to StatusSucceeded.
|
||||||
var payment *MPPayment
|
var payment *MPPayment
|
||||||
payment, err = pControl.Success(info.PaymentHash, preimg)
|
payment, err = pControl.Success(info.PaymentHash, preimg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue