[validator] Fix no valid address on instantiation of Validator

* bump version
bech32
Daniel Van Der Maden 5 years ago
parent e7664217dc
commit d615c6658a
  1. 2
      pyhmy/_version.py
  2. 2
      pyhmy/validator.py

@ -7,5 +7,5 @@ Provides pyhmy version information.
from incremental import Version from incremental import Version
__version__ = Version('pyhmy', 20, 5, 7) __version__ = Version('pyhmy', 20, 5, 8)
__all__ = ["__version__"] __all__ = ["__version__"]

@ -44,6 +44,8 @@ class Validator:
min_required_delegation = 10000 min_required_delegation = 10000
def __init__(self, address): def __init__(self, address):
if not isinstance(address, str):
raise InvalidValidatorError(1, f'given ONE address was not a string.')
if not is_valid_address(address): if not is_valid_address(address):
raise InvalidValidatorError(1, f'{address} is not valid ONE address') raise InvalidValidatorError(1, f'{address} is not valid ONE address')
self._address = address self._address = address

Loading…
Cancel
Save