Commit graph

18 commits

Author SHA1 Message Date
Hennadii Stepanov
a0473442d1
scripted-diff: Add __file__ argument to BitcoinTestFramework.init()
-BEGIN VERIFY SCRIPT-
sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py)
sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py
-END VERIFY SCRIPT-
2024-07-16 22:06:47 +01:00
Andrew Chow
fa53611cf1
Merge bitcoin/bitcoin#26076: Switch hardened derivation marker to h
fe49f06c0e doc: clarify PR 26076 release note (Sjors Provoost)
bd13dc2f46 Switch hardened derivation marker to h in descriptors (Sjors Provoost)

Pull request description:

  This makes it easier to handle descriptor strings manually, especially when importing from another Bitcoin Core wallet.

  For example the `importdescriptors` RPC call is easiest to use `h` as the marker: `'["desc": ".../0h/..."]'`, avoiding the need for escape characters. With this change `listdescriptors` will use `h`, so you can copy-paste the result, without having to add escape characters or switch `'` to 'h' manually.

  Both markers can still be parsed.

  The `hdkeypath` field in `getaddressinfo` is also impacted by this change, except for legacy wallets. The latter is to prevent accidentally breaking ancient software that uses our legacy wallet.

  See discussion in #15740

ACKs for top commit:
  achow101:
    ACK fe49f06c0e
  darosior:
    re-ACK fe49f06c0e

Tree-SHA512: f78bc873b24a6f7a2bf38f5dd58f2b723e35e6b10e4d65c36ec300e2d362d475eeca6e5afa04b3037ab4bee0bf8ebc93ea5fc18102a2111d3d88fc873c08dc89
2023-05-08 13:31:28 -04:00
Sjors Provoost
bd13dc2f46
Switch hardened derivation marker to h in descriptors
This makes it easier to handle descriptor strings manually. E.g. an RPC call that takes an array of descriptors can now use '["desc": ".../0h/..."]'.

Both markers can still be parsed. The default for new descriptors is changed to h. In normalized form h is also used. For private keys the chosen marker is preserved in a round trip.

The hdkeypath field in getaddressinfo is also impacted by this change.
2023-04-04 18:33:08 +02:00
Andrew Chow
1ff135ca7f
Merge bitcoin/bitcoin#26194: rpc, wallet: use the same next_index key in listdescriptors and importdescriptors
b082f28101 rpc, wallet: use the same `next_index` in listdescriptors and importdescriptors (w0xlt)

Pull request description:

  Currently `listdescriptors` RPC uses `next` key to represent `WalletDescriptor::next_index` while `importdescriptors` uses `next_index`. This creates two different descriptor formats.

  This  PR changes `listdescriptors` to use the same key as `importdescriptors`.

ACKs for top commit:
  achow101:
    ACK b082f28101
  aureleoules:
    reACK b082f28101

Tree-SHA512: c29ec59051878e614d749ed6dc85e5c14ad00db0e8fcbce3f5066d1aae85ef07ca70f02920299e48d191b7387024fe224b0054c4191a5951cb805106f7b8e37b
2023-03-08 12:15:31 -05:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
w0xlt
b082f28101 rpc, wallet: use the same next_index in listdescriptors and importdescriptors 2022-12-06 11:38:07 -03:00
Sebastian Falbesoner
dbed28968a test: refactor: eliminate genesis block timestamp magic numbers 2022-12-01 12:59:59 +01:00
MacroFake
555519d082
test: Remove wallet option from non-wallet tests
Review note: The changes are complete, because self.options.descriptors
is set to None in parse_args (test_framework.py).

A value of None implies -disablewallet, see the previous commit.

So if a call to add_wallet_options is missing, it will lead to a test
failure when the wallet is compiled in.
2022-11-10 17:19:13 +01:00
Sebastian Falbesoner
d99af861d0 test: check that listdescriptors descriptor strings are sorted
Tests the change introduced in PR #25931 ("rpc: sort listdescriptors
result", commit 50996241f2).
2022-09-22 19:29:43 +02:00
Andrew Chow
8fb57845ee Create a tr() descriptor bech32m DescriptorScriptPubKeyMan by default 2021-11-16 12:20:13 -05:00
lsilva01
7b3c9e4ee8 Make explicit the node param in init_wallet() 2021-10-20 00:30:28 -03:00
Samuel Dobson
8fa03c4ddf
Merge bitcoin/bitcoin#21500: wallet, rpc: add an option to list private descriptors
bb822a7af8 wallet, rpc: add listdescriptors private option (S3RK)

Pull request description:

  Rationale: make it possible to backup your wallet with `listdescriptors` command

  * The default behaviour is still to show public version
  * For private version only the root xprv is returned

  Example use-case:
  ```
  > bitcoin-cli -regtest -named createwallet wallet_name=old descriptors=true
  > bitcoin-cli -regtest -rpcwallet=old listdescriptors true | jq '.descriptors' > descriptors.txt

  > bitcoin-cli -regtest -named createwallet wallet_name=new descriptors=true blank=true
  > bitcoin-cli -regtest -rpcwallet=new importdescriptors "$(cat descriptors.txt)"
  ```

  In case of watch-only wallet without private keys there will be following output:
  ```
  error code: -4
  error message:
  Can't get descriptor string.
  ```

ACKs for top commit:
  achow101:
    re-ACK bb822a7af8
  Rspigler:
    tACK bb822a7af8
  jonatack:
    ACK bb822a7af8 per `git diff 2854ddc bb822a7`
  prayank23:
    tACK bb822a7af8
  meshcollider:
    Code review ACK bb822a7af8

Tree-SHA512: f6dddc72a74e5667071ccd77f8dce578382e8e29e7ed6a0834ac2e114a6d3918b59c2f194f4079b3259e13d9ba3b4f405619940c3ecb7a1a0344615aed47c43d
2021-08-09 14:09:07 +12:00
Hennadii Stepanov
0c845e3f89
test: Fix wallet_listdescriptors.py if bdb is not compiled 2021-07-14 16:26:08 +03:00
S3RK
bb822a7af8 wallet, rpc: add listdescriptors private option 2021-07-10 15:20:52 +02:00
Andrew Chow
e6cf0ed92d wallet, rpc: listdescriptors does not need unlocked
With the last hardened xpub cache, we don't neeed to have the wallet be
unlocked for listdescriptors.
2021-06-24 14:08:46 -04:00
Ivan Metlushko
2e5f7def22 wallet, rpc: update listdescriptors response format 2021-03-09 09:04:35 +01:00
Ivan Metlushko
a69c3b35f8 wallet: listdescriptors uses normalized descriptor form 2021-02-23 08:51:01 +01:00
Ivan Metlushko
647b81b709 wallet, rpc: add listdescriptors command 2021-01-27 21:22:13 +01:00