@@ -3695,11 +3695,22 @@ fn test_htlc_timeout() {
3695
3695
nodes[ 0 ] . node . handle_update_fail_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & htlc_timeout_updates. update_fail_htlcs [ 0 ] ) ;
3696
3696
commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , htlc_timeout_updates. commitment_signed, false ) ;
3697
3697
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
3698
- match events[ 0 ] {
3699
- Event :: PaymentFailed { payment_hash, rejected_by_dest, error_code } => {
3698
+ match & events[ 0 ] {
3699
+ & Event :: PaymentFailed { payment_hash, rejected_by_dest, error_code, ref error_data } => {
3700
3700
assert_eq ! ( payment_hash, our_payment_hash) ;
3701
3701
assert ! ( rejected_by_dest) ;
3702
3702
assert_eq ! ( error_code. unwrap( ) , 0x4000 | 15 ) ;
3703
+ // 100_000 msat as u64, followed by a height of 122 as u32
3704
+ assert_eq ! ( & error_data. as_ref( ) . unwrap( ) [ ..] , & [
3705
+ ( ( 100_000u64 >> 7 * 8 ) & 0xff ) as u8 ,
3706
+ ( ( 100_000u64 >> 6 * 8 ) & 0xff ) as u8 ,
3707
+ ( ( 100_000u64 >> 5 * 8 ) & 0xff ) as u8 ,
3708
+ ( ( 100_000u64 >> 4 * 8 ) & 0xff ) as u8 ,
3709
+ ( ( 100_000u64 >> 3 * 8 ) & 0xff ) as u8 ,
3710
+ ( ( 100_000u64 >> 2 * 8 ) & 0xff ) as u8 ,
3711
+ ( ( 100_000u64 >> 1 * 8 ) & 0xff ) as u8 ,
3712
+ ( ( 100_000u64 >> 0 * 8 ) & 0xff ) as u8 ,
3713
+ 0 , 0 , 0 , 122 ] ) ;
3703
3714
} ,
3704
3715
_ => panic ! ( "Unexpected event" ) ,
3705
3716
}
0 commit comments