Helper method for optional parameters with docstring#853
Merged
DanGould merged 2 commits intopayjoin:masterfrom Jul 7, 2025
Merged
Helper method for optional parameters with docstring#853DanGould merged 2 commits intopayjoin:masterfrom
DanGould merged 2 commits intopayjoin:masterfrom
Conversation
Collaborator
Pull Request Test Coverage Report for Build 16106375061Details
💛 - Coveralls |
DanGould
reviewed
Jul 6, 2025
Contributor
DanGould
left a comment
There was a problem hiding this comment.
Just the one question. Otherwise looking good
| fn handle_additonal_fee_param( | ||
| max_additional_fee_contribution: Option<bitcoin::Amount>, | ||
| additional_fee_output_index: Option<usize>, | ||
| params: &mut Params, |
Contributor
There was a problem hiding this comment.
Could you not pass mutable reference to just the params.additional_fee_contribution rather than the whole Params struct?
- Mutate &mut self rather than a params: &mut Params argument - Minimize docstring since arguments are self-documenting - Write warn contents on one line to avoid printing all of that whitespace
Contributor
|
Hey @zealsham I wanted to get this one out of the way so that you can have a win and we can iterate. I hope you don't mind my suggestions going straight into a commit on top of yours. If it looks good to you I will squash and merge. Check out my commit message, I made a few changes here. |
Collaborator
Author
|
@DanGould it looks good . i see why passing the the mutable params isnt needed at all |
DanGould
approved these changes
Jul 7, 2025
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 addresess #685
summary
in the specs if the both parameter max_additional_fee_contribution and additional_fee_output_index isn't present then the receiver should not be able to alter sender output https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#optional-parameters
We follow postel's law here and by implementing a helper method with docstring explaining why we proceed and don't fail in this case .