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