Skip to content

Commit 229108c

Browse files
committed
f Check the payment details don't change after DuplicatePayment
1 parent c4ccc92 commit 229108c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/functional_tests.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ fn channel_full_cycle() {
131131
assert_eq!(node_b.payment(&payment_hash).unwrap().direction, PaymentDirection::Inbound);
132132
assert_eq!(node_b.payment(&payment_hash).unwrap().amount_msat, Some(invoice_amount_1_msat));
133133

134-
// Assert we fail duplicate outbound payments.
134+
// Assert we fail duplicate outbound payments and check the status hasn't changed.
135135
assert_eq!(Err(Error::DuplicatePayment), node_a.send_payment(&invoice));
136+
assert_eq!(node_a.payment(&payment_hash).unwrap().status, PaymentStatus::Succeeded);
137+
assert_eq!(node_a.payment(&payment_hash).unwrap().direction, PaymentDirection::Outbound);
138+
assert_eq!(node_a.payment(&payment_hash).unwrap().amount_msat, Some(invoice_amount_1_msat));
139+
assert_eq!(node_b.payment(&payment_hash).unwrap().status, PaymentStatus::Succeeded);
140+
assert_eq!(node_b.payment(&payment_hash).unwrap().direction, PaymentDirection::Inbound);
141+
assert_eq!(node_b.payment(&payment_hash).unwrap().amount_msat, Some(invoice_amount_1_msat));
136142

137143
// Test under-/overpayment
138144
let invoice_amount_2_msat = 1000_000;

0 commit comments

Comments
 (0)