@@ -200,9 +200,10 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
200
200
let events_3 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
201
201
assert_eq ! ( events_3. len( ) , 1 ) ;
202
202
match events_3[ 0 ] {
203
- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
203
+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id : _ } => {
204
204
assert_eq ! ( payment_hash_1, * payment_hash) ;
205
205
assert_eq ! ( amount_msat, 1_000_000 ) ;
206
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
206
207
match & purpose {
207
208
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
208
209
assert ! ( payment_preimage. is_none( ) ) ;
@@ -568,9 +569,10 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
568
569
let events_5 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
569
570
assert_eq ! ( events_5. len( ) , 1 ) ;
570
571
match events_5[ 0 ] {
571
- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
572
+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id : _ } => {
572
573
assert_eq ! ( payment_hash_2, * payment_hash) ;
573
574
assert_eq ! ( amount_msat, 1_000_000 ) ;
575
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
574
576
match & purpose {
575
577
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
576
578
assert ! ( payment_preimage. is_none( ) ) ;
@@ -685,9 +687,10 @@ fn test_monitor_update_fail_cs() {
685
687
let events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
686
688
assert_eq ! ( events. len( ) , 1 ) ;
687
689
match events[ 0 ] {
688
- Event :: PaymentReceived { payment_hash, ref purpose, amount_msat } => {
690
+ Event :: PaymentReceived { payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id : _ } => {
689
691
assert_eq ! ( payment_hash, our_payment_hash) ;
690
692
assert_eq ! ( amount_msat, 1_000_000 ) ;
693
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
691
694
match & purpose {
692
695
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
693
696
assert ! ( payment_preimage. is_none( ) ) ;
@@ -1638,7 +1641,8 @@ fn test_monitor_update_fail_claim() {
1638
1641
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false , true ) ;
1639
1642
1640
1643
// Now restore monitor updating on the 0<->1 channel and claim the funds on B.
1641
- let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_1. 2 ) . unwrap ( ) . clone ( ) ;
1644
+ let channel_id = chan_1. 2 ;
1645
+ let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & channel_id) . unwrap ( ) . clone ( ) ;
1642
1646
nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, latest_update) ;
1643
1647
check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
1644
1648
@@ -1659,9 +1663,11 @@ fn test_monitor_update_fail_claim() {
1659
1663
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
1660
1664
assert_eq ! ( events. len( ) , 2 ) ;
1661
1665
match events[ 0 ] {
1662
- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
1666
+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id } => {
1663
1667
assert_eq ! ( payment_hash_2, * payment_hash) ;
1664
1668
assert_eq ! ( 1_000_000 , amount_msat) ;
1669
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
1670
+ assert_eq ! ( via_user_channel_id, Some ( 42 ) ) ;
1665
1671
match & purpose {
1666
1672
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
1667
1673
assert ! ( payment_preimage. is_none( ) ) ;
@@ -1673,9 +1679,10 @@ fn test_monitor_update_fail_claim() {
1673
1679
_ => panic ! ( "Unexpected event" ) ,
1674
1680
}
1675
1681
match events[ 1 ] {
1676
- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
1682
+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id : _ } => {
1677
1683
assert_eq ! ( payment_hash_3, * payment_hash) ;
1678
1684
assert_eq ! ( 1_000_000 , amount_msat) ;
1685
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
1679
1686
match & purpose {
1680
1687
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
1681
1688
assert ! ( payment_preimage. is_none( ) ) ;
0 commit comments