コード例 #1
0
ファイル: test_bitcoin.py プロジェクト: chrisrico/electrum
 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"))
コード例 #2
0
 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"))
コード例 #3
0
 def test_wif_with_invalid_magic_byte_for_compressed_pubkey(self):
     with self.assertRaises(BitcoinException):
         is_private_key(
             "KwFAa6AumokBD2dVqQLPou42jHiVsvThY1n25HJ8Ji8REf1wxAQb",
             raise_on_error=True)
コード例 #4
0
 def test_segwit_uncompressed_pubkey(self):
     with self.assertRaises(BitcoinException):
         is_private_key(
             "p2wpkh-p2sh:5JKXxT3wAZHcybJ9YNkuHur9vou6uuAnorBV9A8vVxGNFH5wvTW",
             raise_on_error=True)