Skip to content

Conversation

@jbesraa
Copy link
Contributor

@jbesraa jbesraa commented Mar 5, 2024

Resolves the first part of #255 adding the paid fee to the PaymentSuccessful event.


expect_event!(nodes[4], PaymentReceived);
expect_event!(nodes[0], PaymentSuccessful);
let payment_hash = match nodes[4].wait_next_event() {
Copy link
Collaborator

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
PaymentSuccessful {
/// The hash of the payment.
payment_hash: PaymentHash,
/// Paid fee in milli-satoshis.
Copy link
Collaborator

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:

Suggested change
/// 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.
@jbesraa jbesraa force-pushed the paid-fee-in-paymentsuccess-event branch from 53f91ba to e20557c Compare March 6, 2024 15:41

pub(crate) use expect_channel_ready_event;

macro_rules! expect_payment_received_event {
Copy link
Contributor Author

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?

Copy link
Contributor Author

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"

Copy link
Collaborator

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.

@tnull tnull merged commit 02f0000 into lightningdevkit:main Mar 7, 2024
@tnull tnull mentioned this pull request Mar 7, 2024
tnull added a commit that referenced this pull request Mar 7, 2024
@jbesraa jbesraa deleted the paid-fee-in-paymentsuccess-event branch April 27, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants