-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[RPC]Move transaction combining from signrawtransaction to new RPC #10571
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
d342280
to
44fa920
Compare
Concept ACK. However, this does break backward compatibility with an undocumented but apparently intentional and tested feature. Does this require deprecation first? |
f821255
to
5a4a819
Compare
Concept feedback: combining transactions seems like a utility. Is it possible to add it to bitcoin-tx rather than add a utility-only RPC? |
It is not a utility-only RPC. It needs access to the UTXO set. |
aeebcd0
to
c710eb9
Compare
utACK c710eb9eaffa50daddfedb50a93036085b3296c7 |
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
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 c710eb9
although at least the documentation in the RPC test should probably be corrected
src/rpc/rawtransaction.cpp
Outdated
|
||
for (unsigned int idx = 0; idx < txs.size(); idx++) { | ||
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) | ||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed for tx " + idx); |
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.
nit: braces
src/rpc/rawtransaction.cpp
Outdated
} | ||
|
||
if (txVariants.empty()) | ||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transactions"); |
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.
nit: braces
test/functional/rawtransactions.py
Outdated
self.sync_all() | ||
|
||
#THIS IS A INCOMPLETE FEATURE | ||
#NODE2 HAS TWO OF THREE KEY AND THE FUNDS SHOULD BE SPENDABLE AND COUNT AT BALANCE CALCULATION |
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.
This is copy-paste error leading to incorrect documentation of the test. This test is a 2of2 multisig for which node 2 has only 1 key.
Nits addressed and rebased. |
@achow101 It's better if you address the nits separately from rebasing (was rebasing needed?) otherwise its hard to review just the differential and reACK. |
test/functional/rawtransactions.py
Outdated
self.sync_all() | ||
|
||
#THIS IS A INCOMPLETE FEATURE | ||
#NODE2 HAS ONE OF TWO KEY AND THE FUNDS SHOULD BE SPENDABLE AND COUNT AT BALANCE CALCULATION |
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.
This comment is still incorrect. The funds should not be spendable there is nothing incomplete here.
@morcos sorry, I rebased out of habit. |
Now the comment should be right. |
heh thanks... utACK f293282 |
utACK 3cd7a5b |
utACK 3cd7a5bc31e1a3cdd1cc740a884f69d9c6689e2f |
src/rpc/rawtransaction.cpp
Outdated
|
||
for (unsigned int idx = 0; idx < txs.size(); idx++) { | ||
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) { | ||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed for tx " + idx); |
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.
This won't work, you're adding a string and an integer. Use strprintf?
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.
Fixed
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.
… to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of #10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
…et RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: 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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed Conflicts: src/rpc/client.cpp src/rpc/rawtransaction.cpp
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed Conflicts: src/rpc/client.cpp src/rpc/rawtransaction.cpp
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
…nrawtransaction to new RPC" This reverts commit 6478562.
…nrawtransaction to new RPC" This reverts commit 6478562.
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
…saction to new RPC 6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow) Pull request description: 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. The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed. This is part of bitcoin#10570 Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#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. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
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.
The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed.
This is part of #10570