[backport#15744] refactor: Extract ParseDescriptorRange
Summary:
510c6532ba Extract ParseDescriptorRange (Ben Woosley)
Pull request description:
So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks.
Depends on D6614
Backport of Core PR15744
Test Plan:
ninja check test_runner.py wallet_importmulti rpc_scantxoutset
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D6615