-
Notifications
You must be signed in to change notification settings - Fork 412
Generalize add_recipient to accept Address
#1841
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
Generalize add_recipient to accept Address
#1841
Conversation
|
Concept ACK, I guess the same could be done for |
|
That change would require a For 2.0.0, I would consider adding a |
ValuedMammal
left a comment
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.
ACK 3bb94e4
Why would that change require a pub fn set_recipients(
&mut self,
recipients: impl IntoIterator<Item = (impl Into<ScriptBuf>, Amount)>,
) -> &mut Self {
self.params.recipients = recipients
.into_iter()
.map(|(spk, amount)| (spk.into(), amount))
.collect();
self
}The only problem with this is that it will be a breaking change because the compiler needs to know the explicit type of |
evanlinjin
left a comment
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.
ACK 3bb94e4
I was thinking dynamic dispatch would be required, but it is cool to see that is not the case. Good catch on the potentially missing annotations in |
oleonardolima
left a comment
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.
utACK 3bb94e4
3bb94e4 to
de2c44f
Compare
ValuedMammal
left a comment
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.
reACK de2c44f
Description
I would imagine many users would be handling a
Address<NetworkChecked>when building a transaction. They may pass this structure directly with this patch, or continue to useScriptBuf.Notes to the reviewers
To my knowledge this is non-breaking, but it is a change in the function signature so I am not sure.
Changelog notice
Accept any type that is convertible to a
ScriptBufinTxBuilder::add_recipientChecklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
Bugfixes: