routing/payment_lifecycle_test: add step for terminal failure

And modify the MissionControl mock to return a non-nil failure reason in
this case.
This commit is contained in:
Johan T. Halseth committed 2020-04-02 19:29:15 +02:00
1 parent 2e63b518b7
commit 0fd71cd596
2 files changed
+38 -7

No files matched your search

+7
View File
@@ -101,6 +101,13 @@ func (m *mockMissionControl) ReportPaymentFail(paymentID uint64, rt *route.Route
failureSourceIdx *int, failure lnwire.FailureMessage) (
*channeldb.FailureReason, error) {
// Report a permanent failure if this is an error caused
// by incorrect details.
if failure.Code() == lnwire.CodeIncorrectOrUnknownPaymentDetails {
reason := channeldb.FailureReasonPaymentDetails
return &reason, nil
}
return nil, nil
}