docs(lending): add rustdoc headers to three test modules - #853
Merged
nanaf6203-bit merged 2 commits intoJul 29, 2026
Merged
Conversation
) Add a 2-line (or more) rustdoc comment above each of the three #[cfg(test)] modules in contracts/lending/src/lib.rs: • mod tests — core contract lifecycle tests • mod lending_admin_rotation_tests — Issue MettaChain#496 admin key rotation tests • mod storage_derivation_tests — Issue MettaChain#589 compile-time derive assertions Also extend contracts/lending/README.md with a 'Test Module Layout' section that explains which module to extend for different test types, satisfying the discoverability requirement from the issue. Closes MettaChain#785
|
@Tenny150 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Clippy lint empty_line_after_doc_comments (-D warnings) fired on two mod blocks in contracts/lending/src/lib.rs because the /// rustdoc header was followed by a // === banner comment and a blank line before the #[cfg(test)] attribute. Fix: move the // === banners to before the /// doc comment so the doc comment sits directly adjacent to #[cfg(test)] with no intervening blank line or non-doc comments. Affected modules: - mod lending_admin_rotation_tests (Issue MettaChain#496) - mod storage_derivation_tests (Issue MettaChain#589)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #785
contracts/lending/src/lib.rscontains three#[cfg(test)]modules whose purpose was undocumented, making it unclear which module to extend for new tests.Changes
contracts/lending/src/lib.rsAdded a rustdoc comment above each module:
mod tests— describes coverage scope: collateral, pools, margin positions, loan underwriting, servicer integration, loan restructuring, multi-collateral (feat(lending): Support multi-collateral positions (basket collateral) #588), yield farming, governance, and credit scoring. Notes this is where new message tests go.mod lending_admin_rotation_tests— explains the Issue security: Add admin key rotation with timelock to all contracts #496 two-step admin rotation scope and why it is isolated from the main suite.mod storage_derivation_tests— explains the Issue test(lending): Add regression suite for missing-derive bug class #589 compile-time nature of the assertions and instructs contributors to add a newassert_storage_typecall when introducing a new storage struct.contracts/lending/README.mdAdded a Test Module Layout section with a three-row table summarising each module's purpose and instructions for where to add different kinds of tests. Also documents the
src/test.rsregression file.Acceptance Criteria (from issue)
cargo doc --no-depswould render descriptions (doc comments are on themoditems)