lnrpc: ensure parsing of the Amp flag for payments is consistent

In this commit, we fix an inconsistent in the API related to AMP
payments. When a payment request isn't specified, we require the `--amp`
flag on the CLI to make an AMP payment. However, for payment requests,
we don't require this flag. To fix this inconsistency, we now require
the `--amp` flag to _also_ be set for payment requests.
This commit is contained in:
Olaoluwa Osuntokun
2024-04-23 18:33:39 -07:00
parent ab2f34e13b
commit e8031fdccf
4 changed files with 52 additions and 3 deletions

View File

@@ -129,6 +129,7 @@ func testSendPaymentAMPInvoiceCase(ht *lntest.HarnessTest,
PaymentAddr: externalPayAddr,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
Amp: true,
}
payment := ht.SendPaymentAssertSettled(mts.alice, sendReq)
@@ -252,6 +253,7 @@ func testSendPaymentAMPInvoiceRepeat(ht *lntest.HarnessTest) {
// Now we'll use Carol to pay the invoice that Dave created.
ht.CompletePaymentRequests(
carol, []string{addInvoiceResp.PaymentRequest},
lntest.WithAMP(),
)
// Dave should get a notification that the invoice has been settled.
@@ -274,6 +276,7 @@ func testSendPaymentAMPInvoiceRepeat(ht *lntest.HarnessTest) {
// has received another payment.
ht.CompletePaymentRequests(
carol, []string{addInvoiceResp.PaymentRequest},
lntest.WithAMP(),
)
// Dave should get another notification.