Skip to content

feat: document invoice contract public functions - #312

Open
i-amdaveee wants to merge 1 commit into
WHEELBACK:mainfrom
i-amdaveee:feature/add-rustdoc-comments-to-invoicecontract-public-api-both-trees
Open

feat: document invoice contract public functions#312
i-amdaveee wants to merge 1 commit into
WHEELBACK:mainfrom
i-amdaveee:feature/add-rustdoc-comments-to-invoicecontract-public-api-both-trees

Conversation

@i-amdaveee

Copy link
Copy Markdown

Summary

Closes #192

Adds /// rustdoc comments to every public entry point in both invoice contract trees:

  • COMEBACKHERE-contracts/contracts/invoice/src/lib.rs
  • contracts/invoice/src/lib.rs

No logic was changed — this is documentation only.

What was documented

Each public function now has:

  • A summary line describing what it does
  • # Parameters — every argument explained
  • # Returns — where the return value is non-obvious
  • # Errors — every error variant the function can return, with conditions
  • # Events — the event emitted on success (where applicable)

Cross-contract calls are explicitly noted. raise_dispute documents that it calls
treasury.raise_dispute(claimant, settlement_id, reason) and that set_treasury
must be called first. set_treasury links back to raise_dispute in its doc comment.

The contract struct (InvoiceContract) also has a top-level doc comment summarising
the contract's responsibilities and the treasury dependency.

cargo doc output

Both invoice crates pass cargo doc --no-deps with zero warnings from our code.
The only warnings present are unexpected cfg condition value: testutils originating
from the soroban SDK macros themselves — these exist on main before this change.

cargo test output

cargo test fails on both this branch and main with a pre-existing
stellar-xdr/ethnum version conflict unrelated to this change:

error[E0512]: cannot transmute between types of different sizes --> ethnum-1.5.0/src/error.rs:16:14 error: could not compile ethnum (lib) due to 1 previous error error: could not compile stellar-xdr (lib) due to 1836 previous errors

Verified by running `git stash` and reproducing the identical failure on `main`
before our changes were applied.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@i-amdaveee 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 comments to InvoiceContract public API (both trees)

1 participant