-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add new bitcoin@0.17.0 RPC methods to sign raw transactions #80
Conversation
Thank you for your review @pedrobranco! I went ahead and made the requested changes on I also added The docs for
|
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.
Squash all commits, and use a commit message like Add new bitcoin@0.17 RPC methods to sign raw transactions
.
Anytime.
The old one was the third argument, in this new method is the second argument. I've already pushed a comment here. BTW, there is another PR for adding these methods #84. I think we can merge your PR first (despite this PR being a subset of the #84 ). And many thanks for the pull request 👍 |
49b2d89
to
5744267
Compare
@pedrobranco all done I think! Awaiting your input regarding the upper bound in the version range. |
Done. |
@pedrobranco added the multi wallet feature and removed the version cap. I need to squash again, but other than that, is it looking good? |
Just add a test for the new multi-wallet method just to be sure that it works fine. To help I've bumped the docker image for the multi-wallet daemon to |
@lautarodragan Any news on the missing test? We would like to add this to the new release. |
@pedrobranco sorry for the delay! just pushed a commit with mutli wallet tests. |
Hey @pedrobranco & @lautarodragan, Any news for this PR ? do we just need to change the commit message ? Kind regards |
@jeamick @pedrobranco I'll squash the commits but I'd rather wait for feedback first. I'd like to suggest enabling squash-merging for this repository. It allows a clean |
I did the change and compiled it into my repository and it works for signRawTransactionWithKey. |
Any update on this PR ? @lautarodragan @pedrobranco |
@jeamick I think we can consider this repo pretty much abandoned. I decided to fork it and publish here. Haven't had a chance to try it yet, if you do please let me know. I'll be making several changes to the project soon. I intend to keep it compatible with new bitcoin-core releases and add TypeScript type definitions (which I already have for some calls in a different project), as well as fixing some limitations we faced at Po.et. |
This repo is definitely not abandoned @lautarodragan, but we have been focused on other projects at the moment. This library remains tried and tested. Looking forward to bring back my attention to it. Which limitations are you trying to solve? Are those public? |
@ruimarinho that's great news! I think the biggest issue is how we're lagging behind Bitcoin Core releases. Adding TypeScript definitions and making it compatible with modern ES6 modules would be nice too (although you are setting Another issue I found, albeit minor, was trying to use the methods "outside" the object. I don't know how to explain this properly, but for example doing |
I already did the changes on my repo and it is working : https://github.com/jeamick/bitcoin-core |
Awesome! Thanks @jeamick. Please let me know if you give the published version a try. |
Which published version ? I am actually using it for a personal project involving RPC request to bitcoin-core node and everything is working as expected |
|
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.
Fix the minor nits and it's good to merge. Sorry about the delay 😞
test/multi_wallet_test.js
Outdated
@@ -182,6 +168,28 @@ describe('Multi Wallet', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
describe('signRawTransactionWithWallet()', () => { | |||
const getFundedTransaction = async () => { |
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.
To keep consistency, please remove this function and define inside each test.
it('should sign a funded raw transaction and return the hex', async () => { | ||
const fundedTransaction = await getFundedTransaction(); | ||
const signedTransaction = await client.signRawTransactionWithWallet(fundedTransaction.hex); | ||
signedTransaction.should.have.keys('hex'); |
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.
Newline here missing (between await
calls and asserts).
it('should support named parameters', async () => { | ||
const fundedTransaction = await getFundedTransaction(); | ||
const signedTransaction = await client.signRawTransactionWithWallet({ hexstring: fundedTransaction.hex }); | ||
signedTransaction.should.have.keys('hex'); |
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.
Newline here missing (between await
calls and asserts).
I will submit the fix for the tests and merge this. Also, I've squashed all commits. |
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.
LGTM.
Part of #77
Not sure this is right. I just copy-pasted the current
signRawTransaction
, changing the version and name, and updated the version for the deprecatedsignRawTransaction
.Tested the "happy path" case — didn't test that the version filters are working, only that I could correctly call this method. That much works well.