-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add allow_partial
parameter to the "coins to spend" query
#2904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
allow_partial
parameter to the "coins to spend" query
excludedIds: ExcludeInput, | ||
""" | ||
If true, returns available coins instead of failing when the requested amount is unavailable. | ||
""" | ||
allowPartial: Boolean! = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be optional and part of the SpendQueryElementInput
. In this case user can specify which one can be filled partially, and which one can't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #2912
// TODO[RC]: Support partial flag in the AssembleTx transaction | ||
let allow_partial = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we fetch required balances, it should be false
, but when we fetch coins to cover the fee, it can be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #2912
Close in favor of #2912 because of CLA. |
## Linked Issues/PRs Closes #2898 THIS IS A REVIVAL OF #2904 WITH REVIEW COMMENTS ADDRESSED (because of CLA). Inspiration from Rafal. Kudos to @rafal-ch ! ## Description This PR introduces the new allow_partial parameter to the "coins to spend" inputs query. This field is optional to avoid breaking change. If set to true, the query returns available coins instead of failing when the requested amount is unavailable. I consider this change "non-breaking" since the new parameter is not strictly required when sending the query. ## Checklist - [x] New behavior is reflected in tests ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: Mitchell Turner <james.mitchell.turner@gmail.com>
Closes #2898
Description
This PR introduces the new
allow_partial
parameter to the "coins to spend" query. The default value of this parameters isfalse
to preserve the old behavior. If set totrue
, the query returns available coins instead of failing when the requested amount is unavailable.I consider this change "non-breaking" since the new parameter is not strictly required when sending the query.
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]