Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
 def test_public_key_to_address_incorrect_length(self):
     with pytest.raises(ValueError):
         public_key_to_address(PUBLIC_KEY_COMPRESSED[:-1])
Ejemplo n.º 4
0
 def test_public_key_to_address_test_uncompressed(self):
     assert public_key_to_address(
         PUBLIC_KEY_UNCOMPRESSED,
         version='test') == BITCOIN_CASHADDRESS_TEST
Ejemplo n.º 5
0
 def test_public_key_to_address_uncompressed(self):
     assert public_key_to_address(
         PUBLIC_KEY_UNCOMPRESSED) == BITCOIN_CASHADDRESS