mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-05 17:34:38 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a1e8ebef | ||
|
|
9593437a81 | ||
|
|
801bc50fd7 |
@@ -35,12 +35,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv run mypy .
|
uv run mypy .
|
||||||
|
|
||||||
- name: Run tests with pytest
|
- name: Run tests with pytest (with coverage & junit)
|
||||||
env:
|
env:
|
||||||
UPSTREAM_BASE_URL: "http://test"
|
UPSTREAM_BASE_URL: "http://test"
|
||||||
UPSTREAM_API_KEY: "test"
|
UPSTREAM_API_KEY: "test"
|
||||||
run: |
|
run: |
|
||||||
uv run pytest --verbose --tb=short
|
uv run pytest \
|
||||||
|
--verbose --tb=short \
|
||||||
|
--junitxml=pytest.xml \
|
||||||
|
--cov=routstr --cov-report=term
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -320,18 +320,20 @@ async def fetch_provider_health(endpoint_url: str) -> dict[str, Any]:
|
|||||||
is_onion = ".onion" in endpoint_url
|
is_onion = ".onion" in endpoint_url
|
||||||
|
|
||||||
# Set up client arguments conditionally
|
# Set up client arguments conditionally
|
||||||
proxies = None
|
proxies: dict[str, str] | None = None
|
||||||
if is_onion:
|
if is_onion:
|
||||||
try:
|
try:
|
||||||
tor_proxy = settings.tor_proxy_url
|
tor_proxy = settings.tor_proxy_url
|
||||||
except Exception:
|
except Exception:
|
||||||
tor_proxy = "socks5://127.0.0.1:9050"
|
tor_proxy = "socks5://127.0.0.1:9050"
|
||||||
proxies = {"http://": tor_proxy, "https://": tor_proxy} # type: ignore[assignment]
|
proxies = {"http://": tor_proxy, "https://": tor_proxy}
|
||||||
|
|
||||||
async with httpx.AsyncClient(
|
async with httpx.AsyncClient(
|
||||||
timeout=httpx.Timeout(30.0),
|
timeout=httpx.Timeout(30.0),
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
proxies=proxies, # type: ignore[arg-type]
|
# NOTE: httpx < 0.28 supports the 'proxies' kwarg, 0.28+ removed it.
|
||||||
|
# We ignore the call-arg type here to keep compatibility across versions.
|
||||||
|
proxies=proxies, # type: ignore[call-arg]
|
||||||
) as client:
|
) as client:
|
||||||
# Prefer provider's /v1/info for full details
|
# Prefer provider's /v1/info for full details
|
||||||
info_url = f"{endpoint_url.rstrip('/')}/v1/info"
|
info_url = f"{endpoint_url.rstrip('/')}/v1/info"
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ async def recieve_token(
|
|||||||
wallet = await get_wallet(token_obj.mint, token_obj.unit, load=False)
|
wallet = await get_wallet(token_obj.mint, token_obj.unit, load=False)
|
||||||
wallet.keyset_id = token_obj.keysets[0]
|
wallet.keyset_id = token_obj.keysets[0]
|
||||||
|
|
||||||
if token_obj.mint not in settings.cashu_mints:
|
if token_obj.mint.rstrip("/") not in [mint.rstrip("/") for mint in settings.cashu_mints]:
|
||||||
return await swap_to_primary_mint(token_obj, wallet)
|
return await swap_to_primary_mint(token_obj, wallet)
|
||||||
|
|
||||||
wallet.verify_proofs_dleq(token_obj.proofs)
|
wallet.verify_proofs_dleq(token_obj.proofs)
|
||||||
|
|||||||
Reference in New Issue
Block a user