def test_is_private_key(self): for priv_details in self.priv_pub_addr: self.assertTrue(is_private_key(priv_details['priv'])) self.assertTrue(is_private_key(priv_details['exported_privkey'])) self.assertFalse(is_private_key(priv_details['pub'])) self.assertFalse(is_private_key(priv_details['address'])) self.assertFalse(is_private_key("not a privkey"))
def test_is_private_key(self): for priv_details in self.priv_pub_addr: self.assertTrue(is_private_key(priv_details['priv'])) self.assertTrue(is_private_key(priv_details['exported_privkey'])) self.assertFalse(is_private_key(priv_details['pub'])) self.assertFalse(is_private_key(priv_details['address'])) self.assertFalse(is_private_key("not a privkey"))
def test_wif_with_invalid_magic_byte_for_compressed_pubkey(self): with self.assertRaises(BitcoinException): is_private_key( "T35S1qU6BBimysGNP3HG2FbQg9Mox1UbMDgGw5vfsgJakYaq8SfU", raise_on_error=True)
def test_segwit_uncompressed_pubkey(self): with self.assertRaises(BitcoinException): is_private_key( "p2wpkh-p2sh:6udGRabU4ykVSyC14CYs5JdKtHTa7hcpaXaerM9xDQayw9V3r76", raise_on_error=True)