-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
btcjson,rpcclient: add support for PSBT commands to rpcclient #1596
Conversation
46b0594
to
1ee0001
Compare
Hello, you'll need to fix the CI issues in order for this to get reviewed and merged. Thanks for the contribution! |
@Rjected thanks for the heads up! Yeah, its weird though, I could not find out what exactly is it complaining about, the file appears formatted correctly. |
Hey, sorry for getting back so late. Here are the changes you'd need to do to fix the formatting issues: Rjected@23478ac . There are also now some conflicts, make sure those are fixed as well and then we can start reviewing! |
Ah, that makes sense. Thanks for the heads up. |
This is now ready for review. |
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.
Nice work on the PR!
Most of my remarks are about types. Please also feel free to pull in some descriptions from Bitcoin Core docs wherever relevant. It doesn't need to be an exact copy, but just enough to guide the users and show it beautifully on pkg.go.dev.
I'm wondering if btcd/btcjson/btcwalletextcmds.go Lines 5 to 6 in d2b1a06
Compare that to Lines 5 to 6 in d2b1a06
Using |
83e5cef
to
bec3737
Compare
I moved the PSBT methods to |
507b6fc
to
08000bc
Compare
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.
Added some more minor review comments.
btcjson/walletsvrcmds.go
Outdated
var ( | ||
SighashAll SighashType = "ALL" | ||
SighashNone SighashType = "NONE" | ||
SighashSingle SighashType = "SINGLE" | ||
SighashAllAnyoneCanPay SighashType = "ALL|ANYONECANPAY" | ||
SighashNoneAnyoneCanPay SighashType = "NONE|ANYONECANPAY" | ||
SighashSingleAnyoneCanPay SighashType = "SINGLE|ANYONECANPAY" | ||
) |
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.
Would be nice to have comments here as well.
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.
Actually, I just noticed that rpcclient already defines a SigHashType
type. I think it will be more clear to use that and then convert to *string
for the btcjson constructors (to avoid a circular import). This is consistent with the behaviour of SignRawTransaction
.
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.
SigHashType
should've really been in btcjson
package. But there's nothing we can do about it now, without introducing a breaking change. Let's keep it for later.
6f1c59e
to
87e49cd
Compare
Fixed the conflicts, should be ready to merge. |
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.
All good on my side!
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.
Looks good to me.
) (*btcjson.WalletProcessPsbtResult, error) { | ||
return c.WalletProcessPsbtAsync(psbt, sign, sighashType, bip32Derivs).Receive() | ||
} | ||
|
||
// TODO(davec): Implement |
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.
might make sense to remove these in favor of issues, but not germane to this review
No description provided.