Repository navigation
Feat/issues 696 700 702 706 - #828
Merged
misrasamuelisiguzor-oss merged 4 commits intoOct 19, 2026
Merged
misrasamuelisiguzor-oss merged 4 commits into
misrasamuelisiguzor-oss merged 4 commits into
Conversation
Add .github/workflows/check.yml that runs `cargo check --workspace --all-targets` on every PR to main. This catches declared-but-missing modules (mod template; mod transfer; with no backing files) and test-only breakage before merging. Document the required check in CONTRIBUTING.md under 'Before opening a PR'. Closes WHEELBACK#696
MAX_LATE_FEE_BPS was duplicated across invoice.rs (1_000) and validation.rs (1000). Keep a single definition in invoice.rs and import it in validation.rs, eliminating the risk of the two files disagreeing about the cap. - Add `pub const MAX_LATE_FEE_BPS: u32 = 1_000` to invoice.rs as the sole source of truth. - Import MAX_LATE_FEE_BPS in validation.rs; add require_late_fee_within_cap() that validates the late-fee markup against that constant. - Call require_late_fee_within_cap in create_invoice and amend_invoice. - Re-export MAX_LATE_FEE_BPS from lib.rs. Closes WHEELBACK#706
Add a single-call read entrypoint that returns the consolidated refund state and fee breakdown for an invoice (WHEELBACK#700). Changes: - Add MaybeU64 contracttype to invoice.rs (nullable u64 wrapper, mirrors the MaybeAddress/MaybeBytes pattern) and RefundStatus contracttype with fields: status, requested_at, gross_amount, processing_fee, network_fee, net_amount. - Add DataKey::RefundWindow and DataKey::RefundRequestedAt variants to DataKey (append-only; existing discriminants are unchanged). - Update request_refund to store RefundRequestedAt(id) so get_refund_status can return the ledger timestamp of the request without re-reading history. - Add get_refund_status(id) -> Result<RefundStatus, InvoiceError> to lifecycle.rs. Read-only, no auth, works while paused. - Export MaybeU64, RefundStatus from lib.rs. - Update storage_key_uniqueness_test to cover the two new DataKey variants. Closes WHEELBACK#700
Limit how long after payment a refund can be requested (WHEELBACK#702). Payers could previously call request_refund at any time after mark_paid, giving merchants indefinite exposure. This adds an admin-configured refund_window_secs measured from paid_at. When the window elapses, request_refund returns the new RefundWindowClosed error. Zero means no limit, preserving the current behaviour. Changes: - Add RefundWindowClosed = 29 to InvoiceError (appended at the end, no renumbering of existing discriminants). - Add set_refund_window(admin, seconds) and get_refund_window() to admin.rs, following the same pattern as set_grace_window / get_grace_window. - Guard request_refund with the window check: if refund_window > 0 and paid_at + refund_window <= now, return RefundWindowClosed. Uses saturating_add so an astronomically large window never wraps to the past. - DataKey::RefundWindow (unit variant, added in the WHEELBACK#700 commit) is used as the storage key. - Add RefundWindowClosed to the exhaustive match in crates/protocol-errors/src/lib.rs to keep it compiling. Closes WHEELBACK#702
|
@moralstephenxxo-a11y 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.
Description
Related Issue
Closes #696
Closes #706
Closes #700
Closes #702
Checklist
just checkpassing locally