@@ -64,10 +64,24 @@ async fn success() {
6464 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
6565 assert_eq ! ( payment. asset_amount, asset_amount) ;
6666 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
67+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
6768 let payment = get_payment ( node2_addr, & decoded. payment_hash ) . await ;
6869 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
6970 assert_eq ! ( payment. asset_amount, asset_amount) ;
7071 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
72+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
73+ let payment = list_payments ( node1_addr)
74+ . await
75+ . into_iter ( )
76+ . find ( |payment| payment. payment_hash == decoded. payment_hash )
77+ . unwrap ( ) ;
78+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
79+ let payment = list_payments ( node2_addr)
80+ . await
81+ . into_iter ( )
82+ . find ( |payment| payment. payment_hash == decoded. payment_hash )
83+ . unwrap ( ) ;
84+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
7185
7286 let asset_amount = Some ( 50 ) ;
7387 let LNInvoiceResponse { invoice } =
@@ -86,10 +100,12 @@ async fn success() {
86100 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
87101 assert_eq ! ( payment. asset_amount, asset_amount) ;
88102 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
103+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
89104 let payment = get_payment ( node2_addr, & decoded. payment_hash ) . await ;
90105 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
91106 assert_eq ! ( payment. asset_amount, asset_amount) ;
92107 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
108+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
93109
94110 let LNInvoiceResponse { invoice } =
95111 ln_invoice ( node2_addr, None , Some ( & asset_id) , asset_amount, 900 ) . await ;
@@ -100,10 +116,12 @@ async fn success() {
100116 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
101117 assert_eq ! ( payment. asset_amount, asset_amount) ;
102118 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
119+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
103120 let payment = get_payment ( node2_addr, & decoded. payment_hash ) . await ;
104121 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
105122 assert_eq ! ( payment. asset_amount, asset_amount) ;
106123 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
124+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
107125
108126 let LNInvoiceResponse { invoice } =
109127 ln_invoice ( node1_addr, None , Some ( & asset_id) , asset_amount, 900 ) . await ;
@@ -114,10 +132,12 @@ async fn success() {
114132 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
115133 assert_eq ! ( payment. asset_amount, asset_amount) ;
116134 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
135+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
117136 let payment = get_payment ( node2_addr, & decoded. payment_hash ) . await ;
118137 assert_eq ! ( payment. asset_id, Some ( asset_id. clone( ) ) ) ;
119138 assert_eq ! ( payment. asset_amount, asset_amount) ;
120139 assert_eq ! ( payment. status, HTLCStatus :: Succeeded ) ;
140+ check_preimage_matches_hash ( & payment, & decoded. payment_hash ) ;
121141
122142 let channels_1 = list_channels ( node1_addr) . await ;
123143 let channels_2 = list_channels ( node2_addr) . await ;
0 commit comments