diff --git a/itest/lnd_multi-hop_force_close_test.go b/itest/lnd_multi-hop_force_close_test.go index 4284631e86d..1b657d9d50a 100644 --- a/itest/lnd_multi-hop_force_close_test.go +++ b/itest/lnd_multi-hop_force_close_test.go @@ -357,8 +357,11 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, // We'll create two random payment hashes unknown to carol, then send // each of them by manually specifying the HTLC details. carolPubKey := carol.PubKey[:] - dustPayHash := ht.Random32Bytes() - payHash := ht.Random32Bytes() + + preimageDust := ht.RandomPreimage() + preimage := ht.RandomPreimage() + dustPayHash := preimageDust.Hash() + payHash := preimage.Hash() // If this is a taproot channel, then we'll need to make some manual // route hints so Alice can actually find a route. @@ -370,7 +373,7 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, req := &routerrpc.SendPaymentRequest{ Dest: carolPubKey, Amt: int64(dustHtlcAmt), - PaymentHash: dustPayHash, + PaymentHash: dustPayHash[:], FinalCltvDelta: finalCltvDelta, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, @@ -381,7 +384,7 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, req = &routerrpc.SendPaymentRequest{ Dest: carolPubKey, Amt: int64(htlcAmt), - PaymentHash: payHash, + PaymentHash: payHash[:], FinalCltvDelta: finalCltvDelta, TimeoutSeconds: 60, FeeLimitMsat: noFeeLimitMsat, @@ -532,6 +535,10 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest, // Once this transaction has been confirmed, Bob should detect that he // no longer has any pending channels. ht.AssertNumPendingForceClose(bob, 0) + + expectedReason := lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE + ht.AssertPaymentFailureReason(alice, preimage, expectedReason) + ht.AssertPaymentFailureReason(alice, preimageDust, expectedReason) } // testMultiHopReceiverPreimageClaimAnchor tests diff --git a/lntest/harness_assertion.go b/lntest/harness_assertion.go index d5835fe5732..0ea492fe0b4 100644 --- a/lntest/harness_assertion.go +++ b/lntest/harness_assertion.go @@ -1615,7 +1615,8 @@ func (h *HarnessTest) AssertPaymentFailureReason(hn *node.HarnessNode, } return fmt.Errorf("payment: %v failure reason not match, "+ - "want %s got %s", payHash, reason, p.Status) + "want %s(%d) got %s(%d)", payHash, reason, reason, + p.FailureReason, p.FailureReason) }, DefaultTimeout) require.NoError(h, err, "timeout checking payment failure reason") }