aboutsummaryrefslogtreecommitdiff
path: root/src/test/miniscript_tests.cpp
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2023-01-21 13:43:15 +0100
committerAntoine Poinsot <darosior@protonmail.com>2023-10-08 02:43:14 +0200
commitc3738d0344f589162b9ffb78b8e2d78f612d3786 (patch)
treecb0bce30295b44be6d99c79e26d3b97439aaebdf /src/test/miniscript_tests.cpp
parentbba9340a947446cd1c70852f58dcd8aee35be9ac (diff)
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, ..).
Diffstat (limited to 'src/test/miniscript_tests.cpp')
-rw-r--r--src/test/miniscript_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/miniscript_tests.cpp b/src/test/miniscript_tests.cpp
index b69317c4d9..7f90cbc3dd 100644
--- a/src/test/miniscript_tests.cpp
+++ b/src/test/miniscript_tests.cpp
@@ -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. */