Skip to content

Replace psbt_with_fee_contributions with pub fn#1120

Merged
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:rm-session-history-psbt-with-fees
Sep 30, 2025
Merged

Replace psbt_with_fee_contributions with pub fn#1120
spacebear21 merged 1 commit intopayjoin:masterfrom
arminsabouri:rm-session-history-psbt-with-fees

Conversation

@arminsabouri
Copy link
Copy Markdown
Collaborator

@arminsabouri arminsabouri commented Sep 29, 2025

For the Liana example outlined in
#795 (comment) a pub function is more idiomatic and provides better developer experience as developers will not need to interface with the session history -- just the ProvisionalProposal typestate.


Closes: #795

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Sep 29, 2025

Pull Request Test Coverage Report for Build 18135859580

Details

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

Totals Coverage Status
Change from base Build 18135168470: 0.009%
Covered Lines: 8595
Relevant Lines: 10155

💛 - Coveralls

Comment thread payjoin/src/core/receive/v2/session.rs
Comment thread payjoin/src/core/receive/v2/mod.rs Outdated
Comment on lines +997 to +998
/// The Payjoin Psbt with fee contributions applied
pub fn psbt_with_fee_contributions(&self) -> Psbt {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest the following updates to the function name and an accompanying docstring:

Suggested change
/// The Payjoin Psbt with fee contributions applied
pub fn psbt_with_fee_contributions(&self) -> Psbt {
/// The Payjoin proposal PSBT that the receiver needs to sign
///
/// In some applications the entity that progresses the typestate
/// is different from the entity that has access to the private keys,
/// so the PSBT to sign must be accessible to such implementers.
pub fn psbt_to_sign(&self) -> Psbt {

Also, does this need be exposed on the v1 typestate too?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Also, does this need be exposed on the v1 typestate too?

yes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thoughts on the method rename suggestion?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oops missed that. I agree with the naming change. Will make that change now

@arminsabouri arminsabouri force-pushed the rm-session-history-psbt-with-fees branch 3 times, most recently from df52ab4 to 9acf044 Compare September 30, 2025 15:48
For the Liana example outlined in
payjoin#795 (comment)
a pub function is more idiomatic and provides better developer experience
as developers will not need to interface with the session history
-- just the `ProvisionalProposal` typestate.
@arminsabouri arminsabouri force-pushed the rm-session-history-psbt-with-fees branch from 9acf044 to ba6a199 Compare September 30, 2025 15:53
@arminsabouri
Copy link
Copy Markdown
Collaborator Author

@spacebear21 Last push also exposes psbt_to_sign in ffi

Copy link
Copy Markdown
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

ACK ba6a199

@spacebear21 spacebear21 merged commit 53750cc into payjoin:master Sep 30, 2025
14 checks passed
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.

Revisit SessionHistory::psbt_with_fee_contributions

3 participants