예제 #1
0
 def test_public_key_to_address_test_uncompressed(self):
     assert public_key_to_address(PUBLIC_KEY_UNCOMPRESSED, version='test') == LITECOIN_ADDRESS_TEST
예제 #2
0
 def test_public_key_to_address_incorrect_length(self):
     with pytest.raises(ValueError):
         public_key_to_address(PUBLIC_KEY_COMPRESSED[:-1])
예제 #3
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='main')
     return self._address
예제 #4
0
 def test_public_key_to_address_uncompressed(self):
     assert public_key_to_address(PUBLIC_KEY_UNCOMPRESSED) == LITECOIN_ADDRESS
예제 #5
0
파일: keygen.py 프로젝트: starkovalera/lit
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