descriptors: Change Parse to return vector of descriptors

When given a descriptor which contins a multipath derivation specifier,
a vector of descriptors will be returned.
This commit is contained in:
Ava Chow
2024-08-07 16:29:06 -04:00
parent 0d640c6f02
commit 1bbf46e2da
22 changed files with 178 additions and 111 deletions

View File

@@ -69,10 +69,10 @@ static std::optional<std::pair<WalletDescriptor, FlatSigningProvider>> CreateWal
FlatSigningProvider keys;
std::string error;
std::unique_ptr<Descriptor> parsed_desc{Parse(desc_str.value(), keys, error, false)};
if (!parsed_desc) return std::nullopt;
std::vector<std::unique_ptr<Descriptor>> parsed_descs = Parse(desc_str.value(), keys, error, false);
if (parsed_descs.empty()) return std::nullopt;
WalletDescriptor w_desc{std::move(parsed_desc), /*creation_time=*/0, /*range_start=*/0, /*range_end=*/1, /*next_index=*/1};
WalletDescriptor w_desc{std::move(parsed_descs.at(0)), /*creation_time=*/0, /*range_start=*/0, /*range_end=*/1, /*next_index=*/1};
return std::make_pair(w_desc, keys);
}