Skip to content

Reject quantity of 0 for offers with bounded quantity#4667

Open
jkczyz wants to merge 1 commit into
lightningdevkit:mainfrom
jkczyz:2026-06-offer-quantity-check
Open

Reject quantity of 0 for offers with bounded quantity#4667
jkczyz wants to merge 1 commit into
lightningdevkit:mainfrom
jkczyz:2026-06-offer-quantity-check

Conversation

@jkczyz

@jkczyz jkczyz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

An offer advertising Quantity::Bounded expects at least one item, but is_valid_quantity accepted a quantity of 0 since it only checked the upper bound. Require the quantity to be greater than 0 so that an invoice request for 0 items is rejected as an InvalidQuantity.

An offer advertising Quantity::Bounded expects at least one item, but
is_valid_quantity accepted a quantity of 0 since it only checked the
upper bound. Require the quantity to be greater than 0 so that an
invoice request for 0 items is rejected as an InvalidQuantity.

Co-Authored-By: Claude <noreply@anthropic.com>
@ldk-reviews-bot

ldk-reviews-bot commented Jun 9, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@jkczyz jkczyz requested a review from TheBlueMatt June 9, 2026 16:30
@ldk-claude-review-bot

Copy link
Copy Markdown
Collaborator

The change is correct and minimal—it adds the quantity > 0 check for Quantity::Bounded, matching the existing Quantity::Unbounded behavior, with a corresponding test. The test correctly verifies that quantity(0) is rejected as InvalidQuantity.

No issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants