# Task runner for ault-sdk-py. Run `just` with no args to list targets.

default:
    @just --list

# Full local check — lint + format + typecheck + unit tests.
check: lint format-check typecheck test

# Install / refresh the virtual environment.
sync:
    uv sync

# Lint.
lint:
    uv run ruff check .

# Auto-fix lint issues.
lint-fix:
    uv run ruff check --fix .

# Format.
format:
    uv run ruff format .

# Format check (CI).
format-check:
    uv run ruff format --check .

# Type check.
typecheck:
    uv run ty check

# Unit tests.
test:
    uv run pytest tests/unit

# E2E tests (Docker required).
test-e2e:
    uv run pytest tests/e2e -m e2e -n 2

# All tests.
test-all:
    uv run pytest

# Regenerate protobuf bindings (requires Docker + ../ault/proto + ../cosmos-sdk/proto).
gen-proto:
    uv run python scripts/generate_protos.py

# Regenerate DEX OpenAPI client from specs/dex-openapi.yaml.
gen-openapi:
    uv run python scripts/generate_openapi.py

# Regenerate EIP-712 registry from chain protos.
gen-eip712:
    uv run python scripts/generate_eip712_registry.py

# Regenerate everything.
gen-all: gen-proto gen-openapi gen-eip712
