mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
miniscript: introduce a MsContext() helper to contexts
We are going to introduce Tapscript support in Miniscript, for which some of Miniscript rules and properties change (new or modified fragments, different typing rules, different resources consumption, ..).
This commit is contained in:
@@ -114,6 +114,8 @@ typedef std::pair<ChallengeType, uint32_t> Challenge;
|
||||
struct KeyConverter {
|
||||
typedef CPubKey Key;
|
||||
|
||||
const miniscript::MiniscriptContext m_script_ctx{miniscript::MiniscriptContext::P2WSH};
|
||||
|
||||
bool KeyCompare(const Key& a, const Key& b) const {
|
||||
return a < b;
|
||||
}
|
||||
@@ -158,6 +160,10 @@ struct KeyConverter {
|
||||
std::optional<std::string> ToString(const Key& key) const {
|
||||
return HexStr(ToPKBytes(key));
|
||||
}
|
||||
|
||||
miniscript::MiniscriptContext MsContext() const {
|
||||
return m_script_ctx;
|
||||
}
|
||||
};
|
||||
|
||||
/** A class that encapsulates all signing/hash revealing operations. */
|
||||
|
||||
Reference in New Issue
Block a user