Beispiel #1
0
 def testsha256(self):
     for src, result in BitcoinSHA256.vectors:
         self.assertEqual(Bitcoin.hash(src), result)
Beispiel #2
0
 def testsha256(self):
     for src, result in BitcoinSHA256.vectors:
         self.assertEqual(Bitcoin.hash(src), result)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)