Esempio n. 1
0
def setup() -> None:
    """
    This function must be called to set up module state before using the rest of the module
    This is stubbed like so to assist in testing
    """
    global BROADCAST_INTERVAL
    global INTERCHAIN_NETWORK
    global FUNDED
    global _interchain_client
    my_config = matchmaking.get_matchmaking_config()
    BROADCAST_INTERVAL = int(my_config["broadcastInterval"] * 3600)
    INTERCHAIN_NETWORK = my_config["network"]
    FUNDED = my_config["funded"]
    _interchain_client = interchain_dao.get_default_interchain_client()
    _log.info(f"[L5] MY CONFIG -------> {my_config}")
Esempio n. 2
0
def get_v1_status() -> Dict[str, Any]:
    matchmaking_data = matchmaking.get_matchmaking_config()
    response: Dict[str, Any] = {
        "id": str(keys.get_public_id()),
        "level": int(matchmaking_data["level"]),
        "url": str(matchmaking_data["url"]),
        "hashAlgo": str(matchmaking_data["hashAlgo"]),
        "scheme": str(matchmaking_data["scheme"]),
        "version": str(matchmaking_data["version"]),
        "encryptionAlgo": str(matchmaking_data["encryptionAlgo"]),
    }
    # Return extra data if level 5
    if os.environ["LEVEL"] == "5":
        response["funded"] = bool(matchmaking_data["funded"])
        response["network"] = str(matchmaking_data["network"])
        response["broadcastInterval"] = float(matchmaking_data["broadcastInterval"])
        response["interchainWallet"] = str(matchmaking_data["interchainWallet"])
    return response