Add DescriptorCache* read_cache and DescriptorCache* write_cache to Expand and GetPubKey
Summary:
Have Expand, ExpandFromCache, and ExpandHelper take additional DescriptorCache
parameters. These are then passed into PubkeyProvider::GetPubKey which
also takes them as arguments.
Reading and writing to the cache is pushed down into GetPubKey. The old cache where
pubkeys are serialized to a vector is completely removed and instead xpubs are being
cached in DescriptorCache.
Backport of Core PR18204 part [4/7] : https://github.com/bitcoin/bitcoin/pull/18204/commits/58f54b686f663e4c46a2cf7a64560409007c7eb3
Depends on D8383
Test Plan:
ninja all check
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D8384