Skip to content

Implement Paged Recipient Package Listing #81

@Cedarich

Description

@Cedarich

Description

Implement a view to list a recipient’s packages with simple pagination to support UI lists.

Requirements

  • Add list_recipient_packages(env: Env, recipient: Address, cursor: u64, limit: u32) -> Vec<u64>.
  • Behaviour:
    • Iterate from cursor up to cursor + limit or package_counter, whichever comes first.
    • For each existing package where package.recipient == recipient, push package_id into the result.
    • Return the collected IDs; cursor management will be handled by the client.
  • Add tests for:
    • Recipient with few packages (less than limit).
    • Recipient with more packages than a small limit.

Complexity

  • Level: 150

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions