@@ -98,8 +98,10 @@ func testPaymentSucceededHTLCRemoteSwept(ht *lntest.HarnessTest) {
98
98
99
99
// We also check the payments are marked as IN_FLIGHT in Alice's
100
100
// database.
101
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_IN_FLIGHT )
102
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_IN_FLIGHT )
101
+ ht .AssertPaymentStatus (alice , preimage .Hash (), lnrpc .Payment_IN_FLIGHT )
102
+ ht .AssertPaymentStatus (
103
+ alice , dustPreimage .Hash (), lnrpc .Payment_IN_FLIGHT ,
104
+ )
103
105
104
106
// Bob should have two incoming HTLC.
105
107
ht .AssertIncomingHTLCActive (bob , chanPoint , payHash [:])
@@ -166,12 +168,12 @@ func testPaymentSucceededHTLCRemoteSwept(ht *lntest.HarnessTest) {
166
168
dustPayStream := alice .RPC .TrackPaymentV2 (dustPayHash [:])
167
169
168
170
// Check that the dust payment is failed in both the stream and DB.
169
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_FAILED )
171
+ ht .AssertPaymentStatus (alice , dustPreimage . Hash () , lnrpc .Payment_FAILED )
170
172
ht .AssertPaymentStatusFromStream (dustPayStream , lnrpc .Payment_FAILED )
171
173
172
174
// We expect the non-dust payment to marked as succeeded in Alice's
173
175
// database and also from her stream.
174
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_SUCCEEDED )
176
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_SUCCEEDED )
175
177
ht .AssertPaymentStatusFromStream (payStream , lnrpc .Payment_SUCCEEDED )
176
178
}
177
179
@@ -263,8 +265,10 @@ func runTestPaymentHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
263
265
264
266
// We also check the payments are marked as IN_FLIGHT in Alice's
265
267
// database.
266
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_IN_FLIGHT )
267
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_IN_FLIGHT )
268
+ ht .AssertPaymentStatus (alice , preimage .Hash (), lnrpc .Payment_IN_FLIGHT )
269
+ ht .AssertPaymentStatus (
270
+ alice , dustPreimage .Hash (), lnrpc .Payment_IN_FLIGHT ,
271
+ )
268
272
269
273
// Bob should have two incoming HTLC.
270
274
ht .AssertIncomingHTLCActive (bob , chanPoint , payHash [:])
@@ -310,14 +314,14 @@ func runTestPaymentHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
310
314
// mark the non-dust payment as succeeded.
311
315
//
312
316
// Check that the dust payment is failed in both the stream and DB.
313
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_FAILED )
317
+ ht .AssertPaymentStatus (alice , dustPreimage . Hash () , lnrpc .Payment_FAILED )
314
318
ht .AssertPaymentStatusFromStream (dustPayStream , lnrpc .Payment_FAILED )
315
319
316
320
// Check that the non-dust payment is still in-flight.
317
321
//
318
322
// NOTE: we don't check the payment status from the stream here as
319
323
// there's no new status being sent.
320
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_IN_FLIGHT )
324
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_IN_FLIGHT )
321
325
322
326
// We now have two possible cases for the non-dust payment:
323
327
// - Bob stays offline, and Alice will sweep her outgoing HTLC, which
@@ -335,7 +339,7 @@ func runTestPaymentHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
335
339
336
340
// We expect the non-dust payment to marked as failed in Alice's
337
341
// database and also from her stream.
338
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_FAILED )
342
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_FAILED )
339
343
ht .AssertPaymentStatusFromStream (payStream , lnrpc .Payment_FAILED )
340
344
}
341
345
@@ -1114,7 +1118,7 @@ func sendPaymentInterceptAndCancel(ht *lntest.HarnessTest,
1114
1118
var preimage lntypes.Preimage
1115
1119
copy (preimage [:], invoice .RPreimage )
1116
1120
payment := ht .AssertPaymentStatus (
1117
- alice , preimage , lnrpc .Payment_IN_FLIGHT ,
1121
+ alice , preimage . Hash () , lnrpc .Payment_IN_FLIGHT ,
1118
1122
)
1119
1123
reasonNone := lnrpc .PaymentFailureReason_FAILURE_REASON_NONE
1120
1124
require .Equal (ht , reasonNone , payment .FailureReason )
@@ -1127,7 +1131,7 @@ func sendPaymentInterceptAndCancel(ht *lntest.HarnessTest,
1127
1131
require .NoError (ht , err , "failed to send request" )
1128
1132
1129
1133
// Assert that the payment status is as expected.
1130
- ht .AssertPaymentStatus (alice , preimage , expectedPaymentStatus )
1134
+ ht .AssertPaymentStatus (alice , preimage . Hash () , expectedPaymentStatus )
1131
1135
1132
1136
// Since the payment context was cancelled, no further payment attempts
1133
1137
// should've been made, and we observe FAILURE_REASON_CANCELED.
@@ -1245,7 +1249,7 @@ func runSendToRouteFailHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
1245
1249
}()
1246
1250
1247
1251
// Check that the payment is in-flight.
1248
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_IN_FLIGHT )
1252
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_IN_FLIGHT )
1249
1253
1250
1254
// Construct a route to send the dust payment.
1251
1255
go func () {
@@ -1281,7 +1285,9 @@ func runSendToRouteFailHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
1281
1285
}()
1282
1286
1283
1287
// Check that the dust payment is in-flight.
1284
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_IN_FLIGHT )
1288
+ ht .AssertPaymentStatus (
1289
+ alice , dustPreimage .Hash (), lnrpc .Payment_IN_FLIGHT ,
1290
+ )
1285
1291
1286
1292
// Bob should have two incoming HTLC.
1287
1293
ht .AssertIncomingHTLCActive (bob , chanPoint , payHash [:])
@@ -1323,14 +1329,14 @@ func runSendToRouteFailHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
1323
1329
// HTLC is resolved onchain.
1324
1330
//
1325
1331
// Check that the dust payment is failed in both the stream and DB.
1326
- ht .AssertPaymentStatus (alice , dustPreimage , lnrpc .Payment_FAILED )
1332
+ ht .AssertPaymentStatus (alice , dustPreimage . Hash () , lnrpc .Payment_FAILED )
1327
1333
ht .AssertPaymentStatusFromStream (dustPayStream , lnrpc .Payment_FAILED )
1328
1334
1329
1335
// Check that the non-dust payment is still in-flight.
1330
1336
//
1331
1337
// NOTE: we don't check the payment status from the stream here as
1332
1338
// there's no new status being sent.
1333
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_IN_FLIGHT )
1339
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_IN_FLIGHT )
1334
1340
1335
1341
// We now have two possible cases for the non-dust payment:
1336
1342
// - Bob stays offline, and Alice will sweep her outgoing HTLC, which
@@ -1348,6 +1354,6 @@ func runSendToRouteFailHTLCTimeout(ht *lntest.HarnessTest, restartAlice bool) {
1348
1354
1349
1355
// We expect the non-dust payment to marked as failed in Alice's
1350
1356
// database and also from her stream.
1351
- ht .AssertPaymentStatus (alice , preimage , lnrpc .Payment_FAILED )
1357
+ ht .AssertPaymentStatus (alice , preimage . Hash () , lnrpc .Payment_FAILED )
1352
1358
ht .AssertPaymentStatusFromStream (payStream , lnrpc .Payment_FAILED )
1353
1359
}
0 commit comments