From 7d1b1d887eb3298c6aed3cf9320b7cfc5c27ef06 Mon Sep 17 00:00:00 2001 From: Cryp Toon Date: Thu, 30 May 2024 08:29:20 +0200 Subject: [PATCH] Add script locking type unittest --- tests/test_script.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_script.py b/tests/test_script.py index 7a24e49e..aac056ca 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -920,6 +920,12 @@ def test_script_str(self): self.assertListEqual(s.commands, clist) self.assertEqual(s.view(), script_str_2) + def test_script_locking_type(self): + script_str = (b'"\x00 \x04\x7f\x8d]S\x04\xb8\xa1x\xbf\xfb\xd7\xc1\xc0\xc7\xc2To\xc9O\xc3\xb2\x91\n\xdb\x9db' + b'\x19\x85{]\x9f') + self.assertEqual(Script.parse(script_str, is_locking=True).script_types, ['p2wsh']) + self.assertEqual(Script.parse(script_str, is_locking=False).script_types, ['p2sh_p2wsh']) + class TestScriptMPInumbers(unittest.TestCase): def test_encode_decode_numbers(self):