rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

Expose fail() and cancel() on Receiver session

Open spacebear21 opened this issue 2 months ago • 2 comments

This gives implementers the ability to manually fail or cancel a receiver Payjoin session. A user might cancel a session for any reason, or the wallet might fail it if e.g. it detects a double-spend or cannot proceed past a transient error.

Note that the unit tests for closed sessions will need to be reworked once #1132 is merged, since the expected_receiver_state should be an error.

I used Claude sonnet 4.5 (it's quite good) to write the generic methods and unit tests.

Pull Request Checklist

Please confirm the following before requesting review:

spacebear21 avatar Oct 01 '25 22:10 spacebear21

Pull Request Test Coverage Report for Build 18177469540

Details

  • 56 of 56 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 84.648%

Totals Coverage Status
Change from base Build 18176477486: 0.08%
Covered Lines: 8756
Relevant Lines: 10344

💛 - Coveralls

coveralls avatar Oct 01 '25 22:10 coveralls

I wanted to pose a question as to why we really need to have these 2 seperate instead of just having application devs use fail() OR cancel() and provide a reason instead of having both of these?

benalleng avatar Oct 03 '25 20:10 benalleng