Cross-contract mocking test coverage
Labels: testing, priority/medium
Difficulty: Medium · Effort: M
Backlog slot: 65
Problem Statement
Existing tests run against Env::default() and the in-process token stubs (StellarAssetClient). Production cross-contract calls — real RPC, real auth frames, real event ordering — aren't unit-tested for behaviour, only for shape.
Why it Matters
- A
token::Client::new call against an actual deployed token can fail in ways the stub never reproduces (e.g. balance cache lag, expired trustline, missing auth).
- Production regressions are caught by users, not by tests.
Expected Outcome
- Introduce a
MockTokenClient that records assertions (calls, balances, transfers) and lets tests inject failures.
- Apply to
release_milestone, claim_refund, donate paths where token transfers occur.
- Add property tests that mutate the mock state and assert the contract reads.
Acceptance Criteria
Files Likely Affected
- New:
crates/testkit/src/mock_token.rs
campaign/src/test/*
Dependencies
Issue #29 (E2E harness).
Cross-contract mocking test coverage
Labels:
testing,priority/mediumDifficulty: Medium · Effort: M
Backlog slot: 65
Problem Statement
Existing tests run against
Env::default()and the in-process token stubs (StellarAssetClient). Production cross-contract calls — real RPC, real auth frames, real event ordering — aren't unit-tested for behaviour, only for shape.Why it Matters
token::Client::newcall against an actual deployed token can fail in ways the stub never reproduces (e.g. balance cache lag, expired trustline, missing auth).Expected Outcome
MockTokenClientthat records assertions (calls, balances, transfers) and lets tests inject failures.release_milestone,claim_refund,donatepaths where token transfers occur.Acceptance Criteria
Files Likely Affected
crates/testkit/src/mock_token.rscampaign/src/test/*Dependencies
Issue #29 (E2E harness).