diff --git a/itest/lnd_channel_balance_test.go b/itest/lnd_channel_balance_test.go index 72dd16ea34..8ab276d2e6 100644 --- a/itest/lnd_channel_balance_test.go +++ b/itest/lnd_channel_balance_test.go @@ -156,7 +156,7 @@ func testChannelUnsettledBalance(ht *lntest.HarnessTest) { TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) }() } diff --git a/itest/lnd_channel_force_close_test.go b/itest/lnd_channel_force_close_test.go index 70affb6f5f..7538906e43 100644 --- a/itest/lnd_channel_force_close_test.go +++ b/itest/lnd_channel_force_close_test.go @@ -114,7 +114,7 @@ func runChannelForceClosureTest(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) } // Once the HTLC has cleared, all the nodes n our mini network should diff --git a/itest/lnd_forward_interceptor_test.go b/itest/lnd_forward_interceptor_test.go index 9bbecd31b3..6d6cdef7e9 100644 --- a/itest/lnd_forward_interceptor_test.go +++ b/itest/lnd_forward_interceptor_test.go @@ -508,8 +508,7 @@ func testForwardInterceptorWireRecords(ht *lntest.HarnessTest) { FeeLimitMsat: noFeeLimitMsat, FirstHopCustomRecords: customRecords, } - - _ = alice.RPC.SendPayment(sendReq) + ht.SendPaymentAssertInflight(alice, sendReq) // We start the htlc interceptor with a simple implementation that saves // all intercepted packets. These packets are held to simulate a @@ -635,8 +634,7 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) { FeeLimitMsat: noFeeLimitMsat, FirstHopCustomRecords: customRecords, } - - _ = alice.RPC.SendPayment(sendReq) + ht.SendPaymentAssertInflight(alice, sendReq) // We start the htlc interceptor with a simple implementation that saves // all intercepted packets. These packets are held to simulate a diff --git a/itest/lnd_hold_invoice_force_test.go b/itest/lnd_hold_invoice_force_test.go index 7c616e7a50..8cdd8a5298 100644 --- a/itest/lnd_hold_invoice_force_test.go +++ b/itest/lnd_hold_invoice_force_test.go @@ -44,7 +44,7 @@ func testHoldInvoiceForceClose(ht *lntest.HarnessTest) { TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) ht.AssertInvoiceState(stream, lnrpc.Invoice_ACCEPTED) diff --git a/itest/lnd_htlc_timeout_resolver_test.go b/itest/lnd_htlc_timeout_resolver_test.go index 71a44966ed..cd1dd3d483 100644 --- a/itest/lnd_htlc_timeout_resolver_test.go +++ b/itest/lnd_htlc_timeout_resolver_test.go @@ -131,7 +131,7 @@ func testHtlcTimeoutResolverExtractPreimageRemote(ht *lntest.HarnessTest) { TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // Once the payment sent, Alice should have one outgoing HTLC active. ht.AssertOutgoingHTLCActive(alice, aliceChanPoint, payHash[:]) @@ -270,7 +270,7 @@ func testHtlcTimeoutResolverExtractPreimageLocal(ht *lntest.HarnessTest) { TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // Once the payment sent, Alice should have one outgoing HTLC active. ht.AssertOutgoingHTLCActive(alice, aliceChanPoint, payHash[:]) diff --git a/itest/lnd_misc_test.go b/itest/lnd_misc_test.go index 02e3386e6a..33a7067552 100644 --- a/itest/lnd_misc_test.go +++ b/itest/lnd_misc_test.go @@ -632,8 +632,10 @@ func testRejectHTLC(ht *lntest.HarnessTest) { TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - payStream := alice.RPC.SendPayment(paymentReq) - ht.AssertPaymentStatusFromStream(payStream, lnrpc.Payment_FAILED) + ht.SendPaymentAssertFail( + alice, paymentReq, + lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE, + ) ht.AssertLastHTLCError(alice, lnrpc.Failure_CHANNEL_DISABLED) diff --git a/itest/lnd_multi-hop_force_close_test.go b/itest/lnd_multi-hop_force_close_test.go index abc2210503..b21e76dfad 100644 --- a/itest/lnd_multi-hop_force_close_test.go +++ b/itest/lnd_multi-hop_force_close_test.go @@ -298,7 +298,7 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, routeHints = makeRouteHints(bob, carol, params.ZeroConf) } - alice.RPC.SendPayment(&routerrpc.SendPaymentRequest{ + req := &routerrpc.SendPaymentRequest{ Dest: carolPubKey, Amt: int64(dustHtlcAmt), PaymentHash: dustPayHash, @@ -306,9 +306,10 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, RouteHints: routeHints, - }) + } + ht.SendPaymentAssertInflight(alice, req) - alice.RPC.SendPayment(&routerrpc.SendPaymentRequest{ + req = &routerrpc.SendPaymentRequest{ Dest: carolPubKey, Amt: int64(htlcAmt), PaymentHash: payHash, @@ -316,7 +317,8 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, RouteHints: routeHints, - }) + } + ht.SendPaymentAssertInflight(alice, req) // Verify that all nodes in the path now have two HTLC's with the // proper parameters. @@ -645,7 +647,7 @@ func runMultiHopReceiverPreimageClaim(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // At this point, all 3 nodes should now have an active channel with // the created HTLC pending on all of them. @@ -1006,7 +1008,7 @@ func runLocalForceCloseBeforeHtlcTimeout(ht *lntest.HarnessTest, FeeLimitMsat: noFeeLimitMsat, RouteHints: routeHints, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // Once the HTLC has cleared, all channels in our mini network should // have the it locked in. @@ -1335,7 +1337,7 @@ func runRemoteForceCloseBeforeHtlcTimeout(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // Once the HTLC has cleared, all the nodes in our mini network should // show that the HTLC has been locked in. @@ -1594,7 +1596,7 @@ func runLocalClaimIncomingHTLC(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // At this point, all 3 nodes should now have an active channel with // the created HTLC pending on all of them. @@ -1897,7 +1899,7 @@ func runLocalClaimIncomingHTLCLeased(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // At this point, all 3 nodes should now have an active channel with // the created HTLC pending on all of them. @@ -2252,7 +2254,7 @@ func runLocalPreimageClaim(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // At this point, all 3 nodes should now have an active channel with // the created HTLC pending on all of them. @@ -2535,7 +2537,7 @@ func runLocalPreimageClaimLeased(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) // At this point, all 3 nodes should now have an active channel with // the created HTLC pending on all of them. @@ -2982,7 +2984,7 @@ func runHtlcAggregation(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - alice.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(alice, req) } // And Carol will pay Alice's. @@ -2992,7 +2994,7 @@ func runHtlcAggregation(ht *lntest.HarnessTest, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, } - carol.RPC.SendPayment(req) + ht.SendPaymentAssertInflight(carol, req) } // At this point, all 3 nodes should now the HTLCs active on their diff --git a/itest/lnd_watchtower_test.go b/itest/lnd_watchtower_test.go index 80a0eae5a3..a68df852bc 100644 --- a/itest/lnd_watchtower_test.go +++ b/itest/lnd_watchtower_test.go @@ -655,17 +655,12 @@ func generateBackups(ht *lntest.HarnessTest, srcNode, ) send := func(node *node.HarnessNode, payReq string) { - stream := node.RPC.SendPayment( - &routerrpc.SendPaymentRequest{ - PaymentRequest: payReq, - TimeoutSeconds: 60, - FeeLimitMsat: noFeeLimitMsat, - }, - ) - - ht.AssertPaymentStatusFromStream( - stream, lnrpc.Payment_SUCCEEDED, - ) + req := &routerrpc.SendPaymentRequest{ + PaymentRequest: payReq, + TimeoutSeconds: 60, + FeeLimitMsat: noFeeLimitMsat, + } + ht.SendPaymentAssertSettled(node, req) } // Pay each invoice.