Skip to content

Conversation

@jgmcalpine
Copy link

Description

Addresses issue #730.

Added payment_hash() as requested, but also identified that preimage and secret are common fields shared across most PaymentKind variants. Added accessor methods for all three to unify the API.

Changes

  • Added payment_hash(), preimage(), and secret() to PaymentKind.
  • Refactored PaymentDetailsUpdate::from to use these new methods, removing boilerplate matching logic.
  • Added unit test payment_kind_accessor_methods to verify behavior across all variants (Bolt11, Bolt12, Spontaneous, Onchain).

PR Tasks

  • Added tests
  • Ran cargo fmt
  • Ran cargo test

Added payment_hash(), preimage(), and secret() helper methods to PaymentKind. Refactored PaymentDetailsUpdate to use them and added unit tests.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 29, 2025

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

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