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='test') return self._address
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, prefix=self.prefix) return self._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
def test_public_key_to_address_test_uncompressed(self): assert public_key_to_address( PUBLIC_KEY_UNCOMPRESSED, version='test') == BITCOIN_CASHADDRESS_TEST
def test_public_key_to_address_incorrect_length(self): with pytest.raises(ValueError): public_key_to_address(PUBLIC_KEY_COMPRESSED[:-1])
def test_public_key_to_address_uncompressed(self): assert public_key_to_address( PUBLIC_KEY_UNCOMPRESSED) == BITCOIN_CASHADDRESS