File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1428,4 +1428,24 @@ fn spontaneous_send_with_custom_preimage() {
1428
1428
} else {
1429
1429
panic ! ( "Expected a spontaneous PaymentKind with a preimage" ) ;
1430
1430
}
1431
+
1432
+ // Verify receiver side (node_b)
1433
+ expect_payment_received_event ! ( node_b, amount_msat) ;
1434
+ let receiver_payments: Vec < PaymentDetails > = node_b. list_payments_with_filter ( |p| {
1435
+ p. direction == PaymentDirection :: Inbound
1436
+ && matches ! ( p. kind, PaymentKind :: Spontaneous { .. } )
1437
+ } ) ;
1438
+
1439
+ assert_eq ! ( receiver_payments. len( ) , 1 ) ;
1440
+ let receiver_details = & receiver_payments[ 0 ] ;
1441
+ assert_eq ! ( receiver_details. status, PaymentStatus :: Succeeded ) ;
1442
+ assert_eq ! ( receiver_details. amount_msat, Some ( amount_msat) ) ;
1443
+ assert_eq ! ( receiver_details. direction, PaymentDirection :: Inbound ) ;
1444
+
1445
+ // Verify receiver also has the same preimage
1446
+ if let PaymentKind :: Spontaneous { preimage : Some ( pi) , .. } = receiver_details. kind {
1447
+ assert_eq ! ( pi. 0 , custom_bytes) ;
1448
+ } else {
1449
+ panic ! ( "Expected receiver to have spontaneous PaymentKind with preimage" ) ;
1450
+ }
1431
1451
}
You can’t perform that action at this time.
0 commit comments