docs: rustdoc improvements for InvoiceHot, InvoiceStatus, SplitRule, StorageKey - #660
Merged
Kingsman-99 merged 5 commits intoAug 29, 2026
Merged
Conversation
|
@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! 🚀 |
4 tasks
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.
Title
docs: rustdoc improvements for InvoiceHot, InvoiceStatus, SplitRule, StorageKey
Body
This PR is documentation-only and touches
contracts/split/src/types.rsandcontracts/split/src/storage_keys.rs.InvoiceHotintypes.rsalready had a///comment, but lacked a# Designsection. Added one explaining why hot fields live in instance storage (single O(1)extend_ttlcovering all invoices) versus the persistent-storage cold fields (InvoiceCore/InvoiceExt/InvoiceExt2), and the upgrade-wipe trade-off that comes with instance storage.InvoiceStatus::to_u8andInvoiceStatus::from_u8intypes.rsnow have# Examplesdoc tests demonstrating the round trip (Released.to_u8() == 1,from_u8(1) == Released), matching the crate'ssplit::typesmodule path socargo test --docexercises them.SplitRuleintypes.rsnow documents each variant (Fixed,Percentage,Tiered) with a worked numeric example matching the actual release-time computation inlib.rs(e.g.Percentage(3_000)onfunded = 10_000yields3_000;Tiered(5_000, 2_000)onfunded = 8_000yields1_600but0onfunded = 4_000).StorageKeyinstorage_keys.rsnow 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