@@ -219,13 +219,23 @@ fn channel_full_cycle() {
219
219
} ;
220
220
221
221
println ! ( "\n B receive_payment" ) ;
222
- let invoice = node_b. receive_payment ( 1000000 , & "asdf" , 9217 ) . unwrap ( ) ;
222
+ let invoice_amount = 1000000 ;
223
+ let invoice = node_b. receive_payment ( invoice_amount, & "asdf" , 9217 ) . unwrap ( ) ;
223
224
224
225
println ! ( "\n A send_payment" ) ;
225
- node_a. send_payment ( invoice) . unwrap ( ) ;
226
+ let payment_hash = node_a. send_payment ( invoice. clone ( ) ) . unwrap ( ) ;
226
227
227
228
expect_event ! ( node_a, PaymentSuccessful ) ;
228
229
expect_event ! ( node_b, PaymentReceived ) ;
230
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . status, PaymentStatus :: Succeeded ) ;
231
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . direction, PaymentDirection :: Outbound ) ;
232
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount) ) ;
233
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . status, PaymentStatus :: Succeeded ) ;
234
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . direction, PaymentDirection :: Inbound ) ;
235
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount) ) ;
236
+
237
+ // Assert we fail duplicate outbound payments.
238
+ assert_eq ! ( Err ( Error :: NonUniquePaymentHash ) , node_a. send_payment( invoice) ) ;
229
239
230
240
// Test under-/overpayment
231
241
let invoice_amount = 1000000 ;
0 commit comments