Merge #2780: RPC: Backport scantxoutset from BitCoin Core v0.17.2
fe55859c00c6e359bf56f7d678fe67e10d0c41c9 Add functional test for scantxoutset (PeterL73)
44522073079cb0eb885d8b54bceeb6f0c89b3a38 Remove commented out code (PeterL73)
c5ba307dc148dfc924b8908077904fe2ee092203 Backport scantxoutset and descriptors from BitCoin Core v0.17.2 (PeterL73)
Pull request description:
## Issue being fixed or feature implemented
As I didn't like the idea of backporting partial functionality of an upstream feature I looked at how `scantxoutset` and descriptors where implemented in BitCoin Core. Thanks to @tecnovert in #2778 I was able to easily locate the introduction point of `scantxoutset` and descriptors into BitCoin Core. As there were only a few files involved I tried to backport the complete functionality from [BitCoin Core v0.17.2](https://github.com/bitcoin/bitcoin/tree/v0.17.2).
## What was done
- added `script/descriptor.cpp` and `script/descriptor.h` from BitCoin Core
- removed non PIVX compatible code from `script/descriptor.cpp`
- changed `#include <util.h>` to `#include <util/system.h>`
- removed wpkh, wsh support
- added `scantxoutset` related code to `rpc/blockchain.cpp` and `rpc/client.cpp`
- made some minor adjustments in backported code in `rpc/blockchain.cpp`
- changed `HexStr` call used for outputting scriptPubKey
- removed P2WPKH references from the help description
- changed _xpub/xprv_ to _DRKV/DRKP_ as prefix for extended keys in the help description
- added SigningProvider related code to `script/sign.cpp` and `script/sign.h`
- added the functional test `rpc_scantxoutset.py` from BitCoin Core
- changed the addresses and keys to fit PIVX requirements
- changed the first of the "non HD unspent outputs" tests from 0.002 to 0.007, because PIVX does not have P2SH_SEGWIT or BECH32 addresses only LEGACY addresses are used in this test
- https://github.com/dashpay/dash/commit/4127918e86d7b905d2edceffa6913633747664e9
## How Has This Been Tested
This was tested using pivx-cli and pivx-qt, by scanning for unspent transaction output with different descriptors and with the functional test.
## Breaking Changes
ACKs for top commit:
tecnovert:
tACK fe55859c00c6e359bf56f7d678fe67e10d0c41c9
Liquid369:
tACK fe55859c00c6e359bf56f7d678fe67e10d0c41c9
Fuzzbawls:
ACK fe55859c00c6e359bf56f7d678fe67e10d0c41c9
b512d94f6896f77ae47f064dff8f930f10f56f0a Remove semicolon and add "verbose" back to vRPCConvertParams. (tecnovert)
8488f7e08b0f2149558a95a97ae86b8ab736711e Test for hex strings and remove stray newline from rpc_named_arguments. (tecnovert)
f4943e53734d3caada54852ced1254f262576f87 Fix missing help text and add backwards compatibility. (tecnovert)
715f2a2ee6368a0820450979bfc0096341fb9efb rpc: Backport getblock verbosity (tecnovert)
Pull request description:
Changes the boolean 'verbose' parameter of the getblock rpc command to an integer.
Enables getblock output to include full transaction details.
Merge #2774: add include_delegated to vRPCConvertParams
2334061193d0af0faf09bf9693f90f99c8f0d800 add include_delegated to vRPCConvertParams (PeterL73)
Pull request description:
## Issue being fixed #2773
Spending with ```sendmany``` and ```include_delegated``` parameter, results in ```JSON value is not a boolean as expected``` error
```
./pivx-cli sendmany "" "{\"<address>\":1}" 1 "" true
error code: -1
error message:
JSON value is not a boolean as expected
```
```include_delegated``` is missing from vRPCConvertParams
## What was done?
```include_delegated``` was added to vRPCConvertParams
## How Has This Been Tested?
```
./pivx-cli sendmany "" "{\"<address>\":1}" 1 "" true
<transaction hash>
```
The transactions got added
## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [x] I have performed a self-review of my own code
- [x] I have performed a test of my own code
ACKs for top commit:
Liquid369:
uTACK 2334061193d0af0faf09bf9693f90f99c8f0d800
DeanSparrow:
ACK 2334061193d0af0faf09bf9693f90f99c8f0d800
Fuzzbawls:
ACK 2334061193d0af0faf09bf9693f90f99c8f0d800
- changed the addresses and keys to fit PIVX requirments
- changed the first non HD unspent outputs test from 0.002 to 0.007, because PIVX does not have P2SH_SEGWIT and BECH32 addresses, only LEGACY are tested here