Skip to content

feat: add rustdoc/NatSpec-style comments to TreasuryContract public API (#191) - #304

Open
Jay989810 wants to merge 1 commit into
WHEELBACK:mainfrom
Jay989810:feature/add-rustdoc-natspec-style-comments-to-treasurycontract-public-api
Open

feat: add rustdoc/NatSpec-style comments to TreasuryContract public API (#191)#304
Jay989810 wants to merge 1 commit into
WHEELBACK:mainfrom
Jay989810:feature/add-rustdoc-natspec-style-comments-to-treasurycontract-public-api

Conversation

@Jay989810

Copy link
Copy Markdown

Description

This PR adds comprehensive rustdoc/NatSpec-style comments to all public entrypoints, structs, enums, and error types in the TreasuryContract (COMEBACKHERE-contracts/contracts/treasury/src/lib.rs).

Documentation comments include # Arguments, # Returns, and # Errors sections for each function and maintain alignment with docs/contract-interaction-guide.md without duplicating essay-length prose.

Closes #191


Changes Made

  • Rustdoc Documentation:
    • Added /// doc comments for all 16 public entrypoints in TreasuryContract.
    • Added doc comments to public types: SettlementStatus, Settlement, TreasuryError, DataKey, and TreasuryContract.
  • Test Coverage & Fixes:
    • Fixed dependency version lock in Cargo.lock (derive_arbitrary matched to v1.3.2).
    • Added unit tests for unpause, get_threshold, update_threshold, add_token_to_allowlist, remove_token_from_allowlist, deposit, withdraw, and authorization failure cases.
    • Ignored temporary test snapshot directory in .gitignore.

Verification & Test Output

1. cargo doc Build

Command:

cargo doc --no-deps -p comebackhere-treasury
running 30 tests
test integration_dispute_lifecycle::test_raise_dispute_moves_settlement_to_onhold ... ok
test integration_dispute_lifecycle::test_dispute_on_pending_settlement_status_transition ... ok
test integration_dispute_lifecycle::test_resolve_dispute_callable_by_signer ... ok
test integration_settlement_multisig::test_multisig_propose_collect_2_of_3_execute ... ok
test integration_settlement_multisig::test_execute_settlement_verifies_token_transfer_setup ... ok
test tests::test_deposit_and_withdraw ... ok
test integration_settlement_multisig::test_weighted_signers_reach_threshold ... ok
test tests::test_empty_returns_empty ... ok
test integration_dispute_lifecycle::test_multiple_disputes_independent ... ok
test tests::test_get_and_update_threshold ... ok
test tests::test_exact_threshold_executes_settlement ... ok
test tests::test_mixed_statuses_filtered ... ok
test tests::test_limit_capped_at_100 ... ok
test tests::test_over_threshold_single_approval_executes ... ok
test tests::test_pagination_offset_and_limit ... ok
test tests::test_execute_when_paused_returns_contract_paused ... ok
test tests::test_set_signer_when_paused_returns_contract_paused ... ok
test tests::test_multi_signer_weight_accumulates_to_threshold ... ok
test tests::test_propose_when_paused_returns_contract_paused ... ok
test tests::test_single_pending ... ok
test integration_dispute_lifecycle::test_dispute_prevents_execution ... ok
test tests::test_approve_when_paused_returns_contract_paused ... ok
test integration_settlement_multisig::test_multiple_settlements_independent_approvals ... ok
test tests::test_zero_threshold_update_rejected ... ok
test tests::test_partial_approval_below_threshold_does_not_execute ... ok
test tests::test_unauthorized_admin_actions ... ok
test integration_settlement_multisig::test_single_signer_insufficient_for_threshold_2 ... ok
test tests::test_update_threshold_when_paused_returns_contract_paused ... ok
test tests::test_unpause_resumes_operations ... ok
test tests::test_token_allowlist_enforcement ... ok

test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.68s

Add rustdoc/NatSpec-style comments to TreasuryContract public entrypoints, structs, enums, and error types.

- Document parameters, return values, and error conditions for all public functions
- Keep doc comments aligned with docs/contract-interaction-guide.md
- Update test setup and add unit tests for unpause, threshold, token allowlist, deposit, withdraw, and authorization checks
- Fix Cargo.lock derive_arbitrary dependency lock

Closes WHEELBACK#191
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Jay989810 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

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.

Add rustdoc/NatSpec-style comments to TreasuryContract public API

1 participant