mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-07-22 12:22:20 +00:00
Compare commits
3 Commits
dynamic-pr
...
mint-url-n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a1e8ebef | ||
|
|
9593437a81 | ||
|
|
801bc50fd7 |
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@@ -35,12 +35,15 @@ jobs:
|
||||
run: |
|
||||
uv run mypy .
|
||||
|
||||
- name: Run tests with pytest
|
||||
- name: Run tests with pytest (with coverage & junit)
|
||||
env:
|
||||
UPSTREAM_BASE_URL: "http://test"
|
||||
UPSTREAM_API_KEY: "test"
|
||||
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
|
||||
if: always()
|
||||
|
||||
@@ -320,18 +320,20 @@ async def fetch_provider_health(endpoint_url: str) -> dict[str, Any]:
|
||||
is_onion = ".onion" in endpoint_url
|
||||
|
||||
# Set up client arguments conditionally
|
||||
proxies = None
|
||||
proxies: dict[str, str] | None = None
|
||||
if is_onion:
|
||||
try:
|
||||
tor_proxy = settings.tor_proxy_url
|
||||
except Exception:
|
||||
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(
|
||||
timeout=httpx.Timeout(30.0),
|
||||
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:
|
||||
# Prefer provider's /v1/info for full details
|
||||
info_url = f"{endpoint_url.rstrip('/')}/v1/info"
|
||||
|
||||
@@ -28,7 +28,7 @@ async def recieve_token(
|
||||
wallet = await get_wallet(token_obj.mint, token_obj.unit, load=False)
|
||||
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)
|
||||
|
||||
wallet.verify_proofs_dleq(token_obj.proofs)
|
||||
|
||||
Reference in New Issue
Block a user