def test_b58check_encode_then_decode(self): bin_private_key = self.reference['hex_private_key'].decode('hex') wif_private_key = b58check_encode( bin_private_key, version_byte=self.reference['wif_version_byte']) self.assertEqual(self.reference['wif_private_key'], wif_private_key) bin_private_key_verification = b58check_decode(wif_private_key) self.assertEqual(bin_private_key_verification, bin_private_key)
def test_b58check_unpack_then_encode(self): version_byte, bin_private_key, checksum = b58check_unpack( self.reference['wif_private_key']) self.assertTrue( ord(version_byte) == self.reference['wif_version_byte']) wif_private_key = b58check_encode( bin_private_key, version_byte=ord(version_byte)) self.assertEqual(self.reference['wif_private_key'], wif_private_key)
def test_b58check_unpack_then_encode(self): version_byte, bin_private_key, checksum = b58check_unpack( self.reference['wif_private_key']) self.assertTrue( ord(version_byte) == self.reference['wif_version_byte']) wif_private_key = b58check_encode(bin_private_key, version_byte=ord(version_byte)) self.assertEqual(self.reference['wif_private_key'], wif_private_key)