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