Summary
Cross-contract call testing is one of the most requested documentation topics but currently only has a bare-bones example in the examples/cross-contract/ directory. The README does not explain the setup pattern at all.
What's Needed
A full guide section covering:
- Registering multiple contracts in a single MockEnv
- Passing contract IDs between contracts in tests
- Asserting events from inner contracts when an outer contract triggers them
- Authorization chains — how
mock_all_auths propagates through cross-contract calls
- Debugging tips — reading nested call traces
Proposed Structure
Add a new section to README.md:
### Testing Cross-Contract Calls
#### Registering Dependent Contracts
...
#### Routing Contract IDs
...
#### Event Assertions in Nested Calls
...
Also expand examples/cross-contract/src/test.rs with a realistic multi-level call scenario (e.g., Aggregator → AMM Pool → Token).
Acceptance Criteria
Summary
Cross-contract call testing is one of the most requested documentation topics but currently only has a bare-bones example in the
examples/cross-contract/directory. The README does not explain the setup pattern at all.What's Needed
A full guide section covering:
mock_all_authspropagates through cross-contract callsProposed Structure
Add a new section to
README.md:Also expand
examples/cross-contract/src/test.rswith a realistic multi-level call scenario (e.g., Aggregator → AMM Pool → Token).Acceptance Criteria
examples/cross-contracttest expandedcargo test