Wallet config debugging.

This commit is contained in:
empresa 2025-09-09 18:33:23 +07:00
parent afa6a1f84e
commit 6fc2ac9b93
1 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@ def validate_clore_config(clore_config):
1 <= value["on_demand_multiplier"] <= 50 and 1 <= value["spot_multiplier"] <= 50 1 <= value["on_demand_multiplier"] <= 50 and 1 <= value["spot_multiplier"] <= 50
def is_valid_mrl(value): def is_valid_mrl(value):
return isinstance(value, int) and 6 <= value <= 1440 return isinstance(value, int) and 6 <= value <= 3000
def is_valid_keep_params(value): def is_valid_keep_params(value):
return isinstance(value, bool) return isinstance(value, bool)
@ -98,9 +98,9 @@ def validate_clore_config(clore_config):
required_keys = {"on_demand_bitcoin", "on_demand_clore", "spot_bitcoin", "spot_clore"} required_keys = {"on_demand_bitcoin", "on_demand_clore", "spot_bitcoin", "spot_clore"}
if required_keys.issubset(clore_config): if required_keys.issubset(clore_config):
return 0.000001 <= clore_config["on_demand_bitcoin"] <= 0.005 and \ return 0.000001 <= clore_config["on_demand_bitcoin"] <= 0.005 and \
0.1 <= clore_config["on_demand_clore"] <= 5000 and \ 0.1 <= clore_config["on_demand_clore"] <= 10000 and \
0.000001 <= clore_config["spot_bitcoin"] <= 0.005 and \ 0.000001 <= clore_config["spot_bitcoin"] <= 0.005 and \
0.1 <= clore_config["spot_clore"] <= 5000 0.1 <= clore_config["spot_clore"] <= 10000
return False return False
def is_valid_usd_pricing(autoprice): def is_valid_usd_pricing(autoprice):
@ -126,7 +126,7 @@ def validate_clore_config(clore_config):
errors.append("multipliers are not following spec") errors.append("multipliers are not following spec")
if "mrl" not in clore_config or not is_valid_mrl(clore_config["mrl"]): if "mrl" not in clore_config or not is_valid_mrl(clore_config["mrl"]):
errors.append("mrl is mandatory and must be an integer in range 6-1440") errors.append("mrl is mandatory and must be an integer in range 6-3000")
if "keep_params" in clore_config and not is_valid_keep_params(clore_config["keep_params"]): if "keep_params" in clore_config and not is_valid_keep_params(clore_config["keep_params"]):
errors.append("keep_params must be a boolean value") errors.append("keep_params must be a boolean value")