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
This commit is contained in:
Andrew Chow
2023-03-08 12:08:25 -05:00
3 changed files with 12 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class ListDescriptorsTest(BitcoinTestFramework):
assert_equal(4, len([d for d in result['descriptors'] if d['internal']]))
for item in result['descriptors']:
assert item['desc'] != ''
assert item['next'] == 0
assert item['next_index'] == 0
assert item['range'] == [0, 0]
assert item['timestamp'] is not None
@ -78,7 +78,8 @@ class ListDescriptorsTest(BitcoinTestFramework):
'timestamp': TIME_GENESIS_BLOCK,
'active': False,
'range': [0, 0],
'next': 0},
'next': 0,
'next_index': 0},
],
}
assert_equal(expected, wallet.listdescriptors())
@ -92,7 +93,8 @@ class ListDescriptorsTest(BitcoinTestFramework):
'timestamp': TIME_GENESIS_BLOCK,
'active': False,
'range': [0, 0],
'next': 0},
'next': 0,
'next_index': 0},
],
}
assert_equal(expected_private, wallet.listdescriptors(True))