Skip to content

Commit b957689

Browse files
committed
fix: functional tests after RPC changes
1 parent 8a49279 commit b957689

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/wallet/rpc/backup.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ RPCHelpMan listdescriptors()
19771977
{RPCResult::Type::NUM, "timestamp", "The creation time of the descriptor"},
19781978
{RPCResult::Type::BOOL, "active", "Whether this descriptor is currently used to generate new addresses"},
19791979
{RPCResult::Type::BOOL, "internal", /*optional=*/true, "True if this descriptor is used to generate change addresses. False if this descriptor is used to generate receiving addresses; defined only for active descriptors"},
1980-
{RPCResult::Type::BOOL, "coinjoin", /*optional=*/true, "True if this descriptor is used to generate CoinJoin addresses. False if this descriptor is used to generate receiving addresses."},
1980+
{RPCResult::Type::BOOL, "coinjoin", /*optional=*/true, "True if this descriptor is used to generate CoinJoin addresses; defined only if it is True."},
19811981
{RPCResult::Type::ARR_FIXED, "range", /*optional=*/true, "Defined only for ranged descriptors", {
19821982
{RPCResult::Type::NUM, "", "Range start inclusive"},
19831983
{RPCResult::Type::NUM, "", "Range end inclusive"},
@@ -2041,7 +2041,9 @@ RPCHelpMan listdescriptors()
20412041
if (type != std::nullopt) {
20422042
std::string match = strprintf("/%d'/%s'/4'/0'", BIP32_PURPOSE_FEATURE, Params().ExtCoinType());
20432043
bool is_cj = descriptor.find(match) != std::string::npos;
2044-
spk.pushKV("coinjoin", is_cj);
2044+
if (is_cj) {
2045+
spk.pushKV("coinjoin", is_cj);
2046+
}
20452047
}
20462048
if (wallet_descriptor.descriptor->IsRange()) {
20472049
UniValue range(UniValue::VARR);

test/functional/wallet_listdescriptors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def run_test(self):
4949
assert_equal(3, len(result['descriptors']))
5050
assert_equal(2, len([d for d in result['descriptors'] if d['active']]))
5151
self.log.info(f"result: {result['descriptors']}")
52-
assert_equal(1, len([d for d in result['descriptors'] if d['internal']]))
52+
assert_equal(1, len([d for d in result['descriptors'] if 'internal' in d and d['internal']]))
5353
assert_equal(1, len([d for d in result['descriptors'] if 'coinjoin' in d and d['coinjoin']]))
5454
for item in result['descriptors']:
5555
assert item['desc'] != ''

0 commit comments

Comments
 (0)