[RPC] Split signrawtransaction into wallet and non-wallet RPC command #10579

Open
wants to merge 5 commits into
from

Conversation

Projects
None yet
5 participants
Contributor

achow101 commented Jun 12, 2017 edited

This PR is part of #10570. It also builds on top of #10571.

This PR splits signrawtransaction into two commands, signrawtransactionwithkey and signrawtransactionwithwallet. signrawtransactionwithkey requires private keys to be passed in and does not use the wallet for any signing. signrawtransactionwithwallet uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

The signrawtransaction RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

All tests that used signrawtransaction have been updated to use one of the two new RPCs. Most uses were changed to signrawtransactionwithwallet. These were changed via a scripted diff.

Owner

sipa commented Jun 13, 2017

Incorrect scripted diff.

Member

jonasschnelli commented Jun 13, 2017

I'm not entirely sure if this is a good long term strategy.
signrawtransactionwithwallet seems okay(ish) but I don't see a reason to pass around a private key (though RPC, TCP into the same process that runs the p2p/validation/node).

Where are the differences betweenbitcoin-tx's sign command and the here proposed signrawtransactionwithkey?
Wouldn't it make more sense to focus on bitcoin-tx for (offline) rawtx signing?

Contributor

achow101 commented Jun 13, 2017

@jonasschnelli signrawtransactionwithkey will lookup the UTXOs in order to sign whereas bitcoin-tx's `sign' command requires you to supply them. This is much easier to use.

laanwj added this to the 0.15.0 milestone Jul 6, 2017

achow101 added some commits Jun 10, 2017

@achow101 achow101 Move transaction combining from signrawtransaction to new RPC
Create a combinerawtransaction RPC which accepts a json array of hex raw
transactions to combine them into one transaction. Signrawtransaction is changed
to no longer combine transactions and only accept one transaction at a time.
1023869
@achow101 achow101 Split signrawtransaction into wallet and non-wallet
Splits signrwatransaction into a wallet version (signrawtransactionwithwallet) and
non-wallet version (signrawtransactionwithkey). signrawtransaction is marked as DEPRECATED
and will call the right signrawtransaction* command as per the parameters in order to
maintain compatibility.

Updated signrawtransactions test to use new RPCs
1651942
@achow101 achow101 scripted-diff: change signrawtransaction to signrawtransactionwithwal…
…let in tests

-BEGIN VERIFY SCRIPT-
sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/*.py
-END VERIFY SCRIPT-
9d1ecf2
@achow101 achow101 Fix tests broken by previous commit; Add test for signrawtransaction
Fix some tests broken by the scripted diff.

Add a brief test for signrawtransaction to ensure that compatibility is maintained.
c1f9d3e
@achow101 achow101 sqaushme: Comment fix 8674057
Owner

laanwj commented Jul 18, 2017

This has missed the 0.15 feature freeze, moving to 0.16.

@laanwj laanwj modified the milestone: 0.16.0, 0.15.0 Jul 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment