docs: add ContractError guide, event Indexer Guides, calc.rs rationale, InvoiceExt3 storage layout - #667
Open
laddyr141-ui wants to merge 4 commits into
Open
docs: add ContractError guide, event Indexer Guides, calc.rs rationale, InvoiceExt3 storage layout#667laddyr141-ui wants to merge 4 commits into
laddyr141-ui wants to merge 4 commits into
Conversation
|
@laddyr141-ui 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! 🚀 |
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: add ContractError guide, event Indexer Guides, calc.rs rationale, InvoiceExt3 storage layout
Body
This PR adds documentation-only improvements requested across four issues. No code or logic was changed.
#639 — Adds an "Adding a new ContractError variant" section to
CONTRIBUTING.md, explaining the append-only discriminant rule fromcontracts/split/src/error.rs, with a before/after code snippet showing how to correctly add a new variant.#640 — Adds
# Indexer Guidesections tomilestone_reachedandfunding_checkpointincontracts/split/src/events.rs, following the format already used byinvoice_state_changed. Each explains the topic filter, the meaning ofmilestone_bps/threshold_bps, and the event's data fields.#641 — Expands the module doc in
contracts/split/src/calc.rswith a# Why largest-remainder?section explaining why floor division alone leaves up ton-1stroops undistributed, how the largest-remainder method fixes this while preserving thesum(result) == totalinvariant, and a numeric example (10 among 3 equal shares -> [4, 3, 3]).#642 — Adds a
# Storage layoutsection toInvoiceExt3incontracts/split/src/types.rs. Based on readingget_invoice_ext3inlib.rs,InvoiceExt3is not stored as a single serialized struct under one key — it's assembled at read time from four independent persistent-storage entries (rel_dly,fund_led,meta_hsh,paid_rec), each keyed by(Symbol, u64)with the invoice id. The section documents this accurately, including why the fields are split rather than merged into a singleInvoiceKey-style entry.Closes #639
Closes #640
Closes #641
Closes #642