Merge f31c7011fe266caab5bf747d3e677ace1aad625f into 9a6ffa3a2f1da5d0663cc652493dbeb128981ef4
dbfaa0ed
pull/351/merge
300/7,401 ++ 8,529 --
Commits and releases over time
No repositories match that filter.
Drop the localnet-tests feature gate: the generated clients are the algod/ indexer/kmd clients, so exercising them against a live node is core coverage, not an opt-in extra. The endpoint tests now compile and run as part of cargo t, which assumes a running, seeded localnet. sanity.sh and CI seed localnet (cargo api seed-localnet) before cargo t. Deferred tests keep their #[ignore].
Replace the per-test #[ignore = "requires localnet"] with a localnet-tests cargo feature: the generated aggregator is #![cfg]'d off by default so offline cargo t stays green, and enabling the feature against a seeded localnet runs the suite. Deferred tests keep their own #[ignore]. state_lock() moves to an async tokio::sync::Mutex so its guard is safe to hold across the awaits it guards.
seed_localnet + the seed-localnet binary create a shared asset, app, and confirmed payment on localnet and write their ids to a gitignored manifest the endpoint tests read. Seeding also guarantees a block exists for the block-dependent and /ready tests. Verified end-to-end against localnet.
Address serialized only as raw bytes, so the JSON algod REST API (which sends base32 strings) failed to decode into models like Account. Serialize now keys off is_human_readable(); deserialize dispatches on the arriving value via a visitor (string / bytes / byte-seq), since is_human_readable() is unreliable inside serde's buffered internally-tagged Transaction enum decoding. Adds JSON and msgpack round-trip tests.
Implement the endpoints that need no chain state: status, genesis, versions, supply, transaction params, and health. Each calls the typed client method and validates the raw response against the algod OpenAPI schema. All #[ignore]'d; verified live against localnet.
Add a LocalnetFixture that recovers a funded, signable account from the default KMD wallet (list wallets -> open handle -> list keys -> export key), plus helpers to build/sign/submit payments and wait for confirmation. Signing goes through algokit_crypto's ed25519 keypair and algokit_transact's signer. Compile-verified; exercised live in the heavy-seed endpoint tests.
New shared crate holding a capturing HTTP client (records raw response bytes) and a jsonschema validator that checks those bytes against the algod OpenAPI response schemas. Wired as a dev-dependency in the client Cargo.toml template so it survives client regeneration; the dev-dep cycle is dev-only and Cargo-legal. Keeps the harness separate from the dep-free algokit_test_artifacts crate to avoid pulling clients into low-level test builds.
Add a polytest section to api/README.md covering cargo api polytest-algod / polytest-validate-algod, shared across the client crates (indexer/kmd follow).
cargo api polytest-algod clones the upstream polytest catalog via --git, generates the rust endpoint stubs into crates/algod_client/tests/generated/, writes a tests/generated.rs aggregator so cargo test discovers them, and formats. polytest-validate-algod checks catalog<->file parity.
polytest 0.8.1 drops TOML config support, so convert the transact and composer plans to .jsonc (1:1, add version field) and regenerate their markdown test plans with the 0.8.1 template.