Skip to content

docs: rustdoc improvements for InvoiceHot, InvoiceStatus, SplitRule, StorageKey - #660

Merged
Kingsman-99 merged 5 commits into
Stellar-split:mainfrom
lonerthefirst3-sudo:docs-635-638
Aug 29, 2026
Merged

docs: rustdoc improvements for InvoiceHot, InvoiceStatus, SplitRule, StorageKey#660
Kingsman-99 merged 5 commits into
Stellar-split:mainfrom
lonerthefirst3-sudo:docs-635-638

Conversation

@lonerthefirst3-sudo

Copy link
Copy Markdown
Contributor

Title

docs: rustdoc improvements for InvoiceHot, InvoiceStatus, SplitRule, StorageKey

Body

This PR is documentation-only and touches contracts/split/src/types.rs and contracts/split/src/storage_keys.rs.

  • InvoiceHot in types.rs already had a /// comment, but lacked a # Design section. Added one explaining why hot fields live in instance storage (single O(1) extend_ttl covering all invoices) versus the persistent-storage cold fields (InvoiceCore / InvoiceExt / InvoiceExt2), and the upgrade-wipe trade-off that comes with instance storage.

  • InvoiceStatus::to_u8 and InvoiceStatus::from_u8 in types.rs now have # Examples doc tests demonstrating the round trip (Released.to_u8() == 1, from_u8(1) == Released), matching the crate's split::types module path so cargo test --doc exercises them.

  • SplitRule in types.rs now documents each variant (Fixed, Percentage, Tiered) with a worked numeric example matching the actual release-time computation in lib.rs (e.g. Percentage(3_000) on funded = 10_000 yields 3_000; Tiered(5_000, 2_000) on funded = 8_000 yields 1_600 but 0 on funded = 4_000).

  • StorageKey in storage_keys.rs now has an expanded /// doc comment on the enum itself explaining Soroban's 50-variant #[contracttype] limit, why new keys must be appended rather than inserted/reordered (XDR encodes variants positionally), and that a fifth enum should be added if this one nears the cap.

Closes #635
Closes #636
Closes #637
Closes #638

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@lonerthefirst3-sudo 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

@Kingsman-99
Kingsman-99 merged commit d49bfc8 into Stellar-split:main Aug 29, 2026
1 of 4 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

2 participants