mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-12 16:41:46 +00:00
810c3dc7efbfa07e81f161848010e886e04929ea doc, rpc: mention that `listdescriptors` result is sorted by string representation (Sebastian Falbesoner) d99af861d034741649ccea396d825379e681670a test: check that `listdescriptors` descriptor strings are sorted (Sebastian Falbesoner) Pull request description: This small PR adds a test for the change introduced in PR #25931 ("rpc: sort listdescriptors result", commit 50996241f2b0eefeaab4fcd11b9730fa2dc107ae). The correctness of the test can easily be verified by commenting out the `std::sort` call in the `listdescriptors` RPC implementation: ```diff diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 09c74ea2da..3ed1a69b26 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -1829,9 +1829,11 @@ RPCHelpMan listdescriptors() }); } + /* std::sort(wallet_descriptors.begin(), wallet_descriptors.end(), [](const auto& a, const auto& b) { return a.descriptor < b.descriptor; }); + */ UniValue descriptors(UniValue::VARR); for (const WalletDescInfo& info : wallet_descriptors) { ``` leading to a fail of the functional test `wallet_listdescriptors.py`. ACKs for top commit: jarolrod: ACK 810c3dc7efbfa07e81f161848010e886e04929ea aureleoules: ACK 810c3dc7efbfa07e81f161848010e886e04929ea Tree-SHA512: 31770e3149b8a0251ecfa8662a2270c149f778eb910985f48a91d6a5d288b7b1c2244f9f1b798ebe3f1aa9f0b935cb4d6f12d5d28f78bcde3c4a61af76d11d0a