Seedelf-Wallet

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

See the repository root CLAUDE.md for the cross-cutting picture (contract ↔ Rust hash coupling, on-chain invariants, release versioning). This file covers what is specific to the Rust workspace.

Workspace layout

Cargo workspace rooted at Cargo.toml, resolver "3", edition 2024. Members:

Also in this folder but not a Cargo member (bar its wasm/ crate above):

Dependency direction: cli → core, display, koios, crypto; seedelf-wasm → core, koios, crypto; core → crypto + koios; display → koios; koios → crypto. Nothing depends on seedelf-cli, and it’s intentionally NOT in [workspace.dependencies] / [patch.crates-io] — its library target is consumed only by its own main.rs and tests/. The workspace patch table rewrites the published seedelf-{core,crypto,koios,display} crates to local paths so edits propagate without a publish — never remove this when bumping versions, and always bump [workspace.package].version together with the [workspace.dependencies] entries (they must match).

Common commands

# build / install the CLI
cargo build --release --bin seedelf-cli
cargo install --path seedelf-cli --bin seedelf-cli
cargo run -- help                    # from workspace root

# tests
cargo test --workspace --locked      # whole workspace, offline (as CI runs it)
cargo test -p seedelf-crypto         # one crate
cargo test -p seedelf-crypto schnorr # filter by name

# the live Koios tests only (they need the network)
cargo test -p seedelf-cli --test koios_test -- --ignored
cargo test -p seedelf-core --test utxos_test -- --ignored

Tests that ask the public Koios for real are marked #[ignore = "live Koios"] (seedelf-cli’s koios_test.rs, and the find_* tests in seedelf-core’s utxos_test.rs), so the default run and CI stay offline. Run them on purpose with cargo test -- --ignored, named by file as above: they depend on what’s on chain, so a change there can fail them. A bare cargo test -- --ignored at the workspace root runs every ignored test, seedelf-wasm’s record_the_extensions_session_swap_fixture too, which rewrites an extension fixture. A new test that reaches the network gets the same mark, or goes through a mock (wiremock) as tests/cli/ does.

Formatting is governed by rustfmt.toml. No project-level lint script — rely on cargo clippy if running lints.

CLI conventions

Offline integration tests

tests/cli/ drives every transaction-building command’s run() against a mock Koios server (wiremock), decodes the transaction the command tried to submit, and asserts value conservation, min-UTxO floors, and valid change Registers. It relies on four inert-by-default seams (all None/disarmed in production):

These seams are process-global, so every test in the cli binary is #[serial]. Adding a transaction command means adding a test here.

Things that bite