skills/sails-gtest/SKILL.md
Use when a builder needs the standard Gear/Vara Sails gtest loop for feature verification, debugging, or regression coverage. Do not use for live-network-only validation, deployment-first workflows, or non-Sails programs.
npx skillsauth add gear-foundation/vara-skills sails-gtestInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run the Sails-first test loop with generated clients and explicit gtest evidence before any live-node smoke step.
../../assets/gtest-report-template.md — report format for gtest results../../references/gtest-cheatsheet.md — quick reference for gtest APIs../../references/gtest-patterns.md — common test patterns../../references/sails-cheatsheet.md — Sails patterns and APIs../../references/sails-gtest-and-local-validation.md — full gtest and validation guide../../references/gear-gas-reservations-and-waitlist.md — gas reasoning for tests../../references/scale-binary-decoding-guide.md — decoding raw reply bytes../../references/sails-syscall-mapping.md — Syscall::* API for gas, message, and execution contextWrite the result to docs/plans/YYYY-MM-DD-<topic>-gtest.md.
GtestEnv instead of hand-built payloads where the workspace supports them.send_bytes* returns a MessageId, run_next_block returns the BlockRunResult, and the reply evidence lives in the block result.BlockRunMode and advance blocks explicitly when replies or deferred effects depend on progression.run_to_block when delayed work or timeout behavior spans multiple blocks.../sails-local-smoke/SKILL.md only after the suite is green.Rust 2024 listener lifetime: Under edition 2024 capture rules, chaining generated-client calls into listen() can fail with "temporary value dropped while borrowed". In Sails 1.0 the service client implements Listener directly, so bind the service client before listening:
let client = program.service_name();
let mut events = client.listen().await.unwrap();
Program balance accounting in gtest: The deployed program account has an existential deposit. Absolute balance assertions like == wager or == 0 will fail even when the contract accounting logic is correct. Capture the initial balance after deploy and assert deltas relative to that baseline:
let initial_balance = env.balance_of(program_id);
// ... perform actions ...
let final_balance = env.balance_of(program_id);
assert_eq!(final_balance - initial_balance, expected_delta);
Missing block advancement: Forgetting to call run_next_block after sending a message means the reply is never processed. Always advance at least one block after send operations that expect replies.
cargo test output without Sails-appropriate assertions as proof.gtest is still red.#[sails_type] for test-only types that mirror service types, ensuring encoding/decoding matches on-chain behavior exactly.development
Use when approved tasks require Rust code changes in a Sails ethexe workspace with the ethexe feature enabled. Do not use for standard Gear/Vara Sails apps without ethexe, or when the spec or architecture is still unsettled.
development
Use when a builder needs to design or review architecture for a Sails ethexe app with dual-transport, payable methods, Solidity interface generation, or Ethereum-style events. Do not use for standard Gear/Vara Sails apps without ethexe.
development
Use when a builder needs to design or debug calls from a standard Gear/Vara Sails program into runtime builtin actors such as BLS12-381, staking, proxy, or ETH bridge, including ActorId derivation, request encoding, reply decoding, and gas or ED budgeting. Do not use for regular program-to-program messaging, Vara.eth or ethexe-only work, non-Sails repositories, or runtime-maintenance tasks inside the Gear repo.
development
Use when a builder needs a read-side indexer and query API for a standard Gear/Vara Sails app using program events, IDL-driven decoding, projected read models, and optional on-chain query enrichment. Do not use for command-side backends, generic Node APIs, non-Sails repositories, Vara.eth or ethexe-first work.