From a49402a9ec7431c286139b76f8759719a99a8551 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sat, 1 Jul 2023 12:06:47 +0200 Subject: [PATCH] qa: make sure we don't let unspendable Miniscript descriptors be imported --- test/functional/wallet_miniscript.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/functional/wallet_miniscript.py b/test/functional/wallet_miniscript.py index 7bc3424bf45..45f0df1c76b 100755 --- a/test/functional/wallet_miniscript.py +++ b/test/functional/wallet_miniscript.py @@ -277,6 +277,18 @@ class WalletMiniscriptTest(BitcoinTestFramework): assert not res["success"] assert "is not sane: witnesses without signature exist" in res["error"]["message"] + # Sanity check we wouldn't let an unspendable Miniscript descriptor in + res = self.ms_wo_wallet.importdescriptors( + [ + { + "desc": descsum_create("wsh(0)"), + "active": False, + "timestamp": "now", + } + ] + )[0] + assert not res["success"] and "is not satisfiable" in res["error"]["message"] + # Test we can track any type of Miniscript for ms in MINISCRIPTS: self.watchonly_test(ms)