@@ -201,9 +201,10 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
201201 let events_3 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
202202 assert_eq ! ( events_3. len( ) , 1 ) ;
203203 match events_3[ 0 ] {
204- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
204+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
205205 assert_eq ! ( payment_hash_1, * payment_hash) ;
206206 assert_eq ! ( amount_msat, 1_000_000 ) ;
207+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
207208 match & purpose {
208209 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
209210 assert ! ( payment_preimage. is_none( ) ) ;
@@ -569,9 +570,10 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
569570 let events_5 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
570571 assert_eq ! ( events_5. len( ) , 1 ) ;
571572 match events_5[ 0 ] {
572- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
573+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
573574 assert_eq ! ( payment_hash_2, * payment_hash) ;
574575 assert_eq ! ( amount_msat, 1_000_000 ) ;
576+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
575577 match & purpose {
576578 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
577579 assert ! ( payment_preimage. is_none( ) ) ;
@@ -686,9 +688,10 @@ fn test_monitor_update_fail_cs() {
686688 let events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
687689 assert_eq ! ( events. len( ) , 1 ) ;
688690 match events[ 0 ] {
689- Event :: PaymentReceived { payment_hash, ref purpose, amount_msat } => {
691+ Event :: PaymentReceived { payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
690692 assert_eq ! ( payment_hash, our_payment_hash) ;
691693 assert_eq ! ( amount_msat, 1_000_000 ) ;
694+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
692695 match & purpose {
693696 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
694697 assert ! ( payment_preimage. is_none( ) ) ;
@@ -1639,7 +1642,8 @@ fn test_monitor_update_fail_claim() {
16391642 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false , true ) ;
16401643
16411644 // Now restore monitor updating on the 0<->1 channel and claim the funds on B.
1642- let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_1. 2 ) . unwrap ( ) . clone ( ) ;
1645+ let channel_id = chan_1. 2 ;
1646+ let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & channel_id) . unwrap ( ) . clone ( ) ;
16431647 nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, latest_update) ;
16441648 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
16451649
@@ -1660,9 +1664,11 @@ fn test_monitor_update_fail_claim() {
16601664 let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
16611665 assert_eq ! ( events. len( ) , 2 ) ;
16621666 match events[ 0 ] {
1663- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
1667+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , via_user_channel_id } => {
16641668 assert_eq ! ( payment_hash_2, * payment_hash) ;
16651669 assert_eq ! ( 1_000_000 , amount_msat) ;
1670+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
1671+ assert_eq ! ( via_user_channel_id, Some ( 42 ) ) ;
16661672 match & purpose {
16671673 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
16681674 assert ! ( payment_preimage. is_none( ) ) ;
@@ -1674,9 +1680,10 @@ fn test_monitor_update_fail_claim() {
16741680 _ => panic ! ( "Unexpected event" ) ,
16751681 }
16761682 match events[ 1 ] {
1677- Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat } => {
1683+ Event :: PaymentReceived { ref payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
16781684 assert_eq ! ( payment_hash_3, * payment_hash) ;
16791685 assert_eq ! ( 1_000_000 , amount_msat) ;
1686+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
16801687 match & purpose {
16811688 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
16821689 assert ! ( payment_preimage. is_none( ) ) ;
0 commit comments