示例#1
0
 def test_import_wif_network(self):
     # Make a wif for bitcoin testnet:
     testnet_key = PrivateKey(
         self.key._private_key.privkey.secret_multiplier,
         network=BitcoinTestNet)
     testnet_wif = testnet_key.export_to_wif()
     # We should be able to load it properly
     key = PrivateKey.from_wif(testnet_wif, BitcoinTestNet)
     self.assertEqual(testnet_key, key)
示例#2
0
 def setUpClass(cls):
     # This private key chosen from the bitcoin docs:
     # https://en.bitcoin.it/wiki/Wallet_import_format
     cls.expected_private_key = \
         b"18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725"
     cls.private_key = PrivateKey(long_or_int(cls.expected_private_key, 16))
     cls.public_key = PublicKey.from_hex_key(
         "04"
         "50863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352"
         "2cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6")
示例#3
0
 def test_raw_key_hex(self):
     exp = self.key._private_key.privkey.secret_multiplier
     self.assertEqual(PrivateKey(exp), self.key)
示例#4
0
 def setUpClass(cls):
     # This private key chosen from the bitcoin docs:
     # https://en.bitcoin.it/wiki/Wallet_import_format
     cls.expected_key = \
         b"0c28fca386c7a227600b2fe50b7cae11ec86d3bf1fbe471be89827e19d72aa1d"
     cls.key = PrivateKey(long_or_int(cls.expected_key, 16))