-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fee_paid_msat
to PaymentSuccessful
event
#271
Add fee_paid_msat
to PaymentSuccessful
event
#271
Conversation
tests/integration_tests_rust.rs
Outdated
@@ -133,8 +133,28 @@ fn multi_hop_sending() { | |||
let invoice = nodes[4].receive_payment(2_500_000, &"asdf", 9217).unwrap(); | |||
nodes[0].send_payment(&invoice).unwrap(); | |||
|
|||
expect_event!(nodes[4], PaymentReceived); | |||
expect_event!(nodes[0], PaymentSuccessful); | |||
let payment_hash = match nodes[4].wait_next_event() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than breaking the macros here, can we add expect_payment_received_event
and expect_payment_successful_event
macros?
src/event.rs
Outdated
@@ -47,6 +47,8 @@ pub enum Event { | |||
PaymentSuccessful { | |||
/// The hash of the payment. | |||
payment_hash: PaymentHash, | |||
/// Paid fee in milli-satoshis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's borrow a bit more verbose description from PaymentSent
:
/// Paid fee in milli-satoshis. | |
/// The total fee which was spent at intermediate hops in this payment. |
The fee as returned from `PaymentSent` event generated by LDK and is saved in `PaymentSuccessful` event.
53f91ba
to
e20557c
Compare
@@ -80,6 +80,43 @@ macro_rules! expect_channel_ready_event { | |||
|
|||
pub(crate) use expect_channel_ready_event; | |||
|
|||
macro_rules! expect_payment_received_event { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnull I added the following macros following the pattern in the file. for some reason, the macros I added are marked as "unused" although they are used in the multihop test. what am i missing?
Also, should I split the commit for adding those two, or its ok to be in the same commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unused_macros: unused macro definition: expect_payment_successful_event
"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, that's because the file is included individually in all integration tests but not all will use this. No worries, you can just leave it as is and I'll clean up in a follow-up.
Resolves the first part of #255 adding the paid fee to the
PaymentSuccessful
event.