@@ -197,13 +197,23 @@ fn channel_full_cycle() {
197
197
} ;
198
198
199
199
println ! ( "\n B receive_payment" ) ;
200
- let invoice = node_b. receive_payment ( 1000000 , & "asdf" , 9217 ) . unwrap ( ) ;
200
+ let invoice_amount = 1000000 ;
201
+ let invoice = node_b. receive_payment ( invoice_amount, & "asdf" , 9217 ) . unwrap ( ) ;
201
202
202
203
println ! ( "\n A send_payment" ) ;
203
- node_a. send_payment ( invoice) . unwrap ( ) ;
204
+ let payment_hash = node_a. send_payment ( invoice. clone ( ) ) . unwrap ( ) ;
204
205
205
206
expect_event ! ( node_a, PaymentSuccessful ) ;
206
207
expect_event ! ( node_b, PaymentReceived ) ;
208
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . status, PaymentStatus :: Succeeded ) ;
209
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . direction, PaymentDirection :: Outbound ) ;
210
+ assert_eq ! ( node_a. payment_info( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount) ) ;
211
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . status, PaymentStatus :: Succeeded ) ;
212
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . direction, PaymentDirection :: Inbound ) ;
213
+ assert_eq ! ( node_b. payment_info( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount) ) ;
214
+
215
+ // Assert we fail duplicate outbound payments.
216
+ assert_eq ! ( Err ( Error :: NonUniquePaymentHash ) , node_a. send_payment( invoice) ) ;
207
217
208
218
// Test under-/overpayment
209
219
let invoice_amount = 1000000 ;
0 commit comments