def test_public_key_to_address_test_uncompressed(self): assert public_key_to_address(PUBLIC_KEY_UNCOMPRESSED, version='test') == LITECOIN_ADDRESS_TEST
def test_public_key_to_address_incorrect_length(self): with pytest.raises(ValueError): public_key_to_address(PUBLIC_KEY_COMPRESSED[:-1])
def address(self): """The public address you share with others to receive funds.""" if self._address is None: self._address = public_key_to_address(self._public_key, version='main') return self._address
def test_public_key_to_address_uncompressed(self): assert public_key_to_address(PUBLIC_KEY_UNCOMPRESSED) == LITECOIN_ADDRESS
def generate_key_address_pair(): # pragma: no cover private_key = ECPrivateKey() address = public_key_to_address(private_key.public_key.format()) return bytes_to_wif(private_key.secret), address