routing: return full htlc attempt from shard handler

This commit is contained in:
Joost Jager committed 2020-05-12 19:56:50 +02:00
1 parent 8e7c0757ec
commit cc37485432
6 files changed
+76 -41

No files matched your search

+16 -8
View File
@@ -104,15 +104,18 @@ func TestControlTowerSubscribeSuccess(t *testing.T) {
}
// Mark the payment as successful.
err = pControl.SettleAttempt(
info.PaymentHash, attempt.AttemptID,
&channeldb.HTLCSettleInfo{
Preimage: preimg,
},
settleInfo := channeldb.HTLCSettleInfo{
Preimage: preimg,
}
htlcAttempt, err := pControl.SettleAttempt(
info.PaymentHash, attempt.AttemptID, &settleInfo,
)
if err != nil {
t.Fatal(err)
}
if *htlcAttempt.Settle != settleInfo {
t.Fatalf("unexpected settle info returned")
}
// Register a third subscriber after the payment succeeded.
subscriber3, err := pControl.SubscribePayment(info.PaymentHash)
@@ -215,13 +218,18 @@ func testPaymentControlSubscribeFail(t *testing.T, registerAttempt bool) {
}
// Fail the payment attempt.
err := pControl.FailAttempt(
info.PaymentHash, attempt.AttemptID,
&channeldb.HTLCFailInfo{},
failInfo := channeldb.HTLCFailInfo{
Reason: channeldb.HTLCFailInternal,
}
htlcAttempt, err := pControl.FailAttempt(
info.PaymentHash, attempt.AttemptID, &failInfo,
)
if err != nil {
t.Fatalf("unable to fail htlc: %v", err)
}
if *htlcAttempt.Failure != failInfo {
t.Fatalf("unexpected fail info returned")
}
}
// Mark the payment as failed.