0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00
bitcoin-bitcoin-core/src/wallet
Samuel Dobson db656db2ed
Merge #19136: wallet: add parent_desc to getaddressinfo
de6b389d5d tests: Test getaddressinfo parent_desc (Andrew Chow)
e4ac869a0a rpc: Add parent descriptor to getaddressinfo output (Andrew Chow)
bbe4a36152 wallet: Add GetDescriptorString to DescriptorScriptPubKeyMan (Andrew Chow)
9be1437c49 descriptors: Add ToNormalizedString and tests (Andrew Chow)

Pull request description:

  Adds `parent_desc` field to the `getaddressinfo` RPC to export a public descriptor. Using the given address, `getaddressinfo` will look up which `DescriptorScriptPubKeyMan` can be used to produce that address. It will then return the descriptor for that `DescriptorScriptPubKeyMan` in the `parent_desc` field. The descriptor will be in a normalized form where the xpub at the last hardened step is derived so that the descriptor can be imported to other wallets. Tests are added to check that the correct descriptor is being returned for the wallet's addresses and that these descriptors can be imported and used in other wallets.

  As part of this PR, a `ToNormalizedString` function is added to the descriptor classes. This really only has an effect on `BIP32PubkeyProvider`s that have hardened derivation steps. Tests are added to check that normalized descriptors are returned.

ACKs for top commit:
  Sjors:
    utACK de6b389d5d
  S3RK:
    Tested ACK de6b389
  jonatack:
    Tested ACK de6b389d5d modulo a few minor comments
  fjahr:
    Code review ACK de6b389d5d
  meshcollider:
    Tested ACK de6b389d5d

Tree-SHA512: a633e4a39f2abbd95afd7488484cfa66fdd2651dac59fe59f2b80a0940a2a4a13acf889c534a6948903d701484a2ba1218e3081feafe0b9a720dccfa9e43ca2b
2021-02-18 21:51:16 +13:00
..
test Change BOOST_CHECK to BOOST_CHECK_EQUAL to see mismatched values when a check fails. 2021-02-09 15:00:02 +01:00
bdb.cpp Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
bdb.h wallet: Add BerkeleyDB version sanity check at init time 2021-01-17 18:10:20 +01:00
coincontrol.cpp [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coincontrol.h [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coinselection.cpp Merge #20040: wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping 2021-02-01 22:43:17 +13:00
coinselection.h Merge #20040: wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping 2021-02-01 22:43:17 +13:00
context.cpp Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
context.h wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
crypter.cpp Fix occurences of c_str() used with size() to data() 2019-10-28 13:41:45 +01:00
crypter.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
db.cpp wallet: List all wallets in non-SQLite or non-BDB builds 2020-12-04 11:03:28 -04:00
db.h refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
dump.cpp wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
dump.h wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
feebumper.cpp Merge #20584: Declare de facto const reference variables/member functions as const 2021-01-07 09:05:09 +01:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp wallet: Add BerkeleyDB version sanity check at init time 2021-01-17 18:10:20 +01:00
interfaces.cpp Merge #20275: wallet: List all wallets in non-SQLite and non-BDB builds 2020-12-12 09:20:11 +01:00
ismine.h doc: Add developer documentation to isminetype 2021-01-19 19:04:45 +08:00
load.cpp Replace fs::absolute calls with AbsPathJoin calls 2021-01-15 22:48:15 +01:00
load.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
rpcdump.cpp Merge #20211: Use -Wswitch for TxoutType where possible 2021-02-11 11:48:12 +01:00
rpcwallet.cpp Merge #19136: wallet: add parent_desc to getaddressinfo 2021-02-18 21:51:16 +13:00
rpcwallet.h Assert that RPCArg names are equal to CRPCCommand ones (net, rpcwallet) 2020-09-22 20:49:30 +02:00
salvage.cpp refactor: Drop call to GetWalletEnv in wallet salvage code 2020-12-04 11:03:28 -04:00
salvage.h wallettool: Have RecoverDatabaseFile return errors and warnings 2020-07-26 20:22:45 -04:00
scriptpubkeyman.cpp Merge #19136: wallet: add parent_desc to getaddressinfo 2021-02-18 21:51:16 +13:00
scriptpubkeyman.h Merge #19136: wallet: add parent_desc to getaddressinfo 2021-02-18 21:51:16 +13:00
sqlite.cpp refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
sqlite.h doc: fix various typos 2021-01-04 12:31:31 +08:00
wallet.cpp Merge #20040: wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping 2021-02-01 22:43:17 +13:00
wallet.h Merge #20040: wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping 2021-02-01 22:43:17 +13:00
walletdb.cpp wallet: load flags before everything else 2021-02-09 19:01:15 +01:00
walletdb.h Include wallet/bdb.h where it is actually being used 2020-11-18 11:55:43 -05:00
wallettool.cpp refactor: Move all command dependend checks to ExecuteWalletToolFunc 2021-01-21 19:30:34 +01:00
wallettool.h refactor: Move all command dependend checks to ExecuteWalletToolFunc 2021-01-21 19:30:34 +01:00
walletutil.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
walletutil.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00