Skip to content

test(invoice): ID boundary tests — invoice ID wraps at u64::MAX #24

Description

Description

Extend contracts/invoice/tests/invoice_id_boundary_test.rs to set InvoiceCount manually to u64::MAX - 1 and verify that creating one more invoice succeeds (ID = u64::MAX) and the next creation returns an overflow error rather than wrapping to 0.

Requirements and context

The current boundary tests exist but may not cover the exact u64::MAX wrap scenario. Preventing ID wrap-around protects against a critical storage collision where a new invoice overwrites invoice #1's data.

Suggested execution

Fork the repo and create a branch:

git checkout -b test/invoice-id-u64max-wrap

Update invoice_id_boundary_test.rs with a direct storage manipulation to set the count near max.

Test and commit

test(invoice): add u64::MAX invoice ID boundary and wrap-around test

Guidelines

Assignment required before starting. PR description must include: Closes #[issue_id]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions