@@ -201,9 +201,10 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
201
201
let events_3 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
202
202
assert_eq ! ( events_3. len( ) , 1 ) ;
203
203
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 , .. } => {
205
205
assert_eq ! ( payment_hash_1, * payment_hash) ;
206
206
assert_eq ! ( amount_msat, 1_000_000 ) ;
207
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
207
208
match & purpose {
208
209
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
209
210
assert ! ( payment_preimage. is_none( ) ) ;
@@ -569,9 +570,10 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
569
570
let events_5 = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
570
571
assert_eq ! ( events_5. len( ) , 1 ) ;
571
572
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 , .. } => {
573
574
assert_eq ! ( payment_hash_2, * payment_hash) ;
574
575
assert_eq ! ( amount_msat, 1_000_000 ) ;
576
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
575
577
match & purpose {
576
578
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
577
579
assert ! ( payment_preimage. is_none( ) ) ;
@@ -686,9 +688,10 @@ fn test_monitor_update_fail_cs() {
686
688
let events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
687
689
assert_eq ! ( events. len( ) , 1 ) ;
688
690
match events[ 0 ] {
689
- Event :: PaymentReceived { payment_hash, ref purpose, amount_msat } => {
691
+ Event :: PaymentReceived { payment_hash, ref purpose, amount_msat, via_channel_id , .. } => {
690
692
assert_eq ! ( payment_hash, our_payment_hash) ;
691
693
assert_eq ! ( amount_msat, 1_000_000 ) ;
694
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
692
695
match & purpose {
693
696
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
694
697
assert ! ( payment_preimage. is_none( ) ) ;
@@ -1639,7 +1642,8 @@ fn test_monitor_update_fail_claim() {
1639
1642
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false , true ) ;
1640
1643
1641
1644
// 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 ( ) ;
1643
1647
nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, latest_update) ;
1644
1648
check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
1645
1649
@@ -1660,9 +1664,11 @@ fn test_monitor_update_fail_claim() {
1660
1664
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
1661
1665
assert_eq ! ( events. len( ) , 2 ) ;
1662
1666
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 } => {
1664
1668
assert_eq ! ( payment_hash_2, * payment_hash) ;
1665
1669
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 ) ) ;
1666
1672
match & purpose {
1667
1673
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
1668
1674
assert ! ( payment_preimage. is_none( ) ) ;
@@ -1674,9 +1680,10 @@ fn test_monitor_update_fail_claim() {
1674
1680
_ => panic ! ( "Unexpected event" ) ,
1675
1681
}
1676
1682
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 , .. } => {
1678
1684
assert_eq ! ( payment_hash_3, * payment_hash) ;
1679
1685
assert_eq ! ( 1_000_000 , amount_msat) ;
1686
+ assert_eq ! ( via_channel_id, Some ( channel_id) ) ;
1680
1687
match & purpose {
1681
1688
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
1682
1689
assert ! ( payment_preimage. is_none( ) ) ;
0 commit comments