Files
plm-lottery/apps/lottery/addresses.py
T

18 lines
629 B
Python

"""The address under which a participant appears in the public draw list (RND-14, DAT-65)."""
from django.conf import settings
from plm_engine.address import is_valid_address as _is_valid
from .simulation import simulated_address
def participant_address(user) -> str:
if settings.LEDGER_BACKEND == "simulated":
return simulated_address(user)
raise NotImplementedError("HD addresses arrive with phase B (roadmap B4)")
def is_valid_address(address: str) -> bool:
"""A destination on the configured network: its hrp is the profile's (ADR-58, ADR-05)."""
return _is_valid(address, settings.PLM_PROFILE)