Skip to content

docs(lending): add rustdoc headers to three test modules - #853

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Tenny150:fix/785-lending-test-module-docs
Jul 29, 2026
Merged

docs(lending): add rustdoc headers to three test modules#853
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
Tenny150:fix/785-lending-test-module-docs

Conversation

@Tenny150

Copy link
Copy Markdown
Contributor

Summary

Fixes #785

contracts/lending/src/lib.rs contains three #[cfg(test)] modules whose purpose was undocumented, making it unclear which module to extend for new tests.

Changes

contracts/lending/src/lib.rs

Added a rustdoc comment above each module:

contracts/lending/README.md

Added 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.rs regression file.

Acceptance Criteria (from issue)

  • Each block carries a 2-line (or more) rustdoc header
  • cargo doc --no-deps would render descriptions (doc comments are on the mod items)
  • README mentions the layout of all test files

)

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
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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)

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanaf6203-bit
nanaf6203-bit merged commit be8689b into MettaChain:main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the three lending test modules' purpose

2 participants