test/docs(invoice): u64::MAX ID boundary tests + public entrypoint Rustdoc - #177
Open
softnationz wants to merge 3 commits into
Open
softnationz wants to merge 3 commits into
softnationz wants to merge 3 commits into
Conversation
- Import MaybeBytes in invoice_id_boundary_test.rs - Fix all create_invoice / try_create_invoice calls to match the 7-arg signature (metadata_hash, payment_link_hash, merchant_nonce) - test_overflow_wrapping_at_u64_max_is_not_silent: seeds InvoiceCount to MAX-1, asserts first call lands at u64::MAX, then asserts the next call errors (arithmetic overflow) rather than silently wrapping to 0 and colliding with the missing-invoice sentinel Closes WHEELBACK#24
Add /// doc comments to every pub fn in contracts/invoice/src/lib.rs that lacked them: initialize, create_invoice, mark_paid, get_invoice, get_invoice_status, cancel_invoice, request_refund, pause, unpause. Documents parameters, return values, errors, and auth requirements. Expands the existing create_invoice comment from 3 lines to full per-param and error-list coverage matching the release_escrow style. Closes WHEELBACK#25
|
@softnationz 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.
Summary
Two issues addressed in separate commits.
Closes #24 — u64::MAX invoice ID boundary and wrap-around test
The existing boundary tests used the old 4-arg
create_invoicesignature, so they would not have compiled since the 7-arg form was introduced. Fixed:MaybeBytesto the import line ininvoice_id_boundary_test.rs.create_invoice/try_create_invoicecall to pass&MaybeBytes::None, &MaybeBytes::None, &0.test_overflow_wrapping_at_u64_max_is_not_silent: seedsInvoiceCounttou64::MAX - 1viaenv.as_contract, asserts the first call returnsu64::MAX, then asserts the next call errors (arithmetic overflow oncount + 1) rather than silently wrapping to 0 and colliding with the missing-invoice sentinel.Closes #25 — Rustdoc on all public entrypoints
Added
///doc comments to everypub fnincontracts/invoice/src/lib.rsthat had none:initialize,create_invoice,mark_paid,get_invoice,get_invoice_status,cancel_invoice,request_refund,pause,unpause.Each comment documents parameters, return value, auth requirement, and the full error list, following the style of the existing
release_escrowandset_grace_windowcomments.