1760@@ -1761,7 +1761,7 @@ struct KeyParser {
1761 std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index, Span<const char>& sp, ParseScriptContext ctx, FlatSigningProvider& out, std::string& error)
1762 {
1763 using namespace script;
1764-
1765+ Assume(ctx != ParseScriptContext::P2WPKH);
I’m not sure about this. I think Assume(ctx != ParseScriptContext::P2WPKH)
is shorter and easier to understand.
It’s definitely shorter, for sure. A thought here is that if another context is added and it’s not appropriate for the function, the check for allowed contexts would still work (conversely the !P2WPKH check would miss it silently). If another context is added and it is appropriate, then we’re informed to add it (the assume would fail in a debug build), which also serves as a reminder to ensure the function is updated appropriately.
Yes, fair enough. I will address it.