Skip to content

Light refactor to v2 receiver for readability#1585

Open
xstoicunicornx wants to merge 1 commit into
payjoin:masterfrom
xstoicunicornx:refactor-lite-v2-receiver
Open

Light refactor to v2 receiver for readability#1585
xstoicunicornx wants to merge 1 commit into
payjoin:masterfrom
xstoicunicornx:refactor-lite-v2-receiver

Conversation

@xstoicunicornx
Copy link
Copy Markdown
Collaborator

Summary

This is a light refactor to mainly restructure match arms in the v2 receiver typestates to return directly from each branch instead of binding an intermediate value and returning after the match. Also renames a shadowed inner binding to payjoin_psbt for clarity and adds consistency to .save().expect() pattern in a test.

This refactor was written in preparation of implementing PR 1446. Improving the readability of these match arms will make it easier to review the interface changes introduced in PR 1446.

Pull Request Checklist

Please confirm the following before requesting review:

Restructure match arms in the v2 receiver typestates to
return directly from each branch instead of binding an
intermediate value and returning after the match. Also
rename a shadowed `inner` binding to `payjoin_psbt` for
clarity.
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 26543710624

Coverage increased (+0.004%) to 85.144%

Details

  • Coverage increased (+0.004%) from the base build.
  • Patch coverage: 15 uncovered changes across 1 file (44 of 59 lines covered, 74.58%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
payjoin/src/core/receive/v2/mod.rs 59 44 74.58%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 13698
Covered Lines: 11663
Line Coverage: 85.14%
Coverage Strength: 394.93 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cACK 6da7ae5

Meta nit: In the future please consider splitting the renaming and test changes (if they are unrelated to a refactor) into seperate commits.

Thanks!

@xstoicunicornx
Copy link
Copy Markdown
Collaborator Author

Meta nit noted! Thank you for the feedback.

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.

3 participants