@@ -200,9 +200,10 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
200200 let events_3 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
201201 assert_eq ! ( events_3. len( ) , 1 ) ;
202202 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 , .. } => {
204204 assert_eq ! ( payment_hash_1, * payment_hash) ;
205205 assert_eq ! ( amount_msat, 1_000_000 ) ;
206+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
206207 match & purpose {
207208 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
208209 assert ! ( payment_preimage. is_none( ) ) ;
@@ -568,9 +569,10 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
568569 let events_5 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
569570 assert_eq ! ( events_5. len( ) , 1 ) ;
570571 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 , .. } => {
572573 assert_eq ! ( payment_hash_2, * payment_hash) ;
573574 assert_eq ! ( amount_msat, 1_000_000 ) ;
575+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
574576 match & purpose {
575577 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
576578 assert ! ( payment_preimage. is_none( ) ) ;
@@ -685,9 +687,10 @@ fn test_monitor_update_fail_cs() {
685687 let events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
686688 assert_eq ! ( events. len( ) , 1 ) ;
687689 match events[ 0 ] {
688- Event :: PaymentReceived { payment_hash, ref purpose, amount_msat } => {
690+ Event :: PaymentReceived { payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
689691 assert_eq ! ( payment_hash, our_payment_hash) ;
690692 assert_eq ! ( amount_msat, 1_000_000 ) ;
693+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
691694 match & purpose {
692695 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
693696 assert ! ( payment_preimage. is_none( ) ) ;
@@ -1638,7 +1641,8 @@ fn test_monitor_update_fail_claim() {
16381641 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false , true ) ;
16391642
16401643 // 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 ( ) ;
16421646 nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, latest_update) ;
16431647 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
16441648
@@ -1659,9 +1663,11 @@ fn test_monitor_update_fail_claim() {
16591663 let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
16601664 assert_eq ! ( events. len( ) , 2 ) ;
16611665 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 } => {
16631667 assert_eq ! ( payment_hash_2, * payment_hash) ;
16641668 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 ) ) ;
16651671 match & purpose {
16661672 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
16671673 assert ! ( payment_preimage. is_none( ) ) ;
@@ -1673,9 +1679,10 @@ fn test_monitor_update_fail_claim() {
16731679 _ => panic ! ( "Unexpected event" ) ,
16741680 }
16751681 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 , .. } => {
16771683 assert_eq ! ( payment_hash_3, * payment_hash) ;
16781684 assert_eq ! ( 1_000_000 , amount_msat) ;
1685+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
16791686 match & purpose {
16801687 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
16811688 assert ! ( payment_preimage. is_none( ) ) ;
0 commit comments