def test_op_return_script(self):
     case1 = "6a"
     script = Script.from_hex(a2b_hex(case1))
     self.assertEqual("OP_RETURN", script.value)
     self.assertFalse(script.is_pubkey())
     self.assertFalse(script.is_multisig())
     self.assertFalse(script.is_p2sh())
     self.assertFalse(script.is_p2wpkh())
     self.assertFalse(script.is_p2wsh())
     self.assertFalse(script.is_pubkeyhash())
     self.assertFalse(script.is_unknown())
     self.assertTrue(script.is_return())
 def test_pubkey_script(self):
     script = Script.from_hex(
         a2b_hex(
             "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac"
         ))
     self.assertTrue(script.is_pubkey())
     self.assertFalse(script.is_multisig())
     self.assertFalse(script.is_p2sh())
     self.assertFalse(script.is_p2wpkh())
     self.assertFalse(script.is_p2wsh())
     self.assertFalse(script.is_pubkeyhash())
     self.assertFalse(script.is_unknown())
     self.assertFalse(script.is_return())
 def test_invalid_script(self):
     case = "40"
     script = Script.from_hex(a2b_hex(case))
     self.assertEqual("INVALID_SCRIPT", script.value)
 def test_from_hex(self):
     case1 = "6a"
     script = Script.from_hex(a2b_hex(case1))
     self.assertEqual("OP_RETURN", script.value)
Esempio n. 5
0
 def test_from_hex(self):
     case1 = "6a"
     script = Script.from_hex(a2b_hex(case1))
     self.assertEqual("OP_RETURN", script.value)