示例#1
0
 def testsha256(self):
     for src, result in BitcoinSHA256.vectors:
         self.assertEqual(Bitcoin.hash(src), result)
示例#2
0
 def testsha256(self):
     for src, result in BitcoinSHA256.vectors:
         self.assertEqual(Bitcoin.hash(src), result)
示例#3
0
 def test_serialize_public_key(self):
     pubkey = keys.PrivateKey(Bitcoin.hash(b"test case")).get_public_key(False)
     data = pubkey.as_hex()
     pubkey2 = keys.PublicKey.from_hex(data)
     self.assertEqual(pubkey, pubkey2)
示例#4
0
 def test_serialize_private_key(self):
     pk = keys.PrivateKey(Bitcoin.hash(b"test case"))
     data = pk.serialize()
     pk2, v = keys.PrivateKey.unserialize(data)
     self.assertEqual(v, b"")
     self.assertEqual(pk, pk2)
示例#5
0
 def test_serialize_public_key(self):
     pubkey = keys.PrivateKey(
         Bitcoin.hash(b'test case')).get_public_key(False)
     data = pubkey.as_hex()
     pubkey2 = keys.PublicKey.from_hex(data)
     self.assertEqual(pubkey, pubkey2)
示例#6
0
 def test_serialize_private_key(self):
     pk = keys.PrivateKey(Bitcoin.hash(b'test case'))
     data = pk.serialize()
     pk2, v = keys.PrivateKey.unserialize(data)
     self.assertEqual(v, b'')
     self.assertEqual(pk, pk2)