Closed
Conversation
Collaborator
Pull Request Test Coverage Report for Build 18551723885Details
💛 - Coveralls |
The function was modifying a local copy of params but never using the modified version, causing a linter error.
1584feb to
9a3f8c8
Compare
Collaborator
|
Have we considered not just allowing |
Contributor
Author
Thank you for the insight ! |
Collaborator
|
Yeah, this obviously is something to consider as this is a pub fn, perhaps others have some stronger opinions if this is a no go. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR Closes #1162
Problem
The function identify_receiver_outputs was modifying a local copy of
paramsbut never using the modified version, causing a linter error. The issue was that the function signature only returnedVec<usize>(the owned_vouts), so the modified params were lost.This also stops the lint and lint ffi test workflow to fail
Looking at the logic, it looks like the intention was to modify the params to remove the additional_fee_contribution if it points to a receiver output. However, since the function couldn't return the modified params, the modification was useless.
Solution
Changed the return type of
identify_receiver_outputsfromResult<Vec<usize>, Error>toResult<(Vec<usize>, Self), Error>to return both the owned vouts and the filtered payload.Created variable original_payload by constructing a new
Selfinstance with the modified paramsUpdated the return statement** to return both values
Updated all callers in the codebase to handle the new return type In v1/mod.rs,In v2/mod.rs
the lint test also passes in my branch test workflow : https://github.com/Mshehu5/rust-payjoin/actions/runs/18546726647
Please confirm the following before requesting review: