Skip to content

i_with predicate enforces singleton quantity without indicating so in name/signature #30

@lambdacc

Description

@lambdacc

Describe the bug
In cocktail/vodka_inputs.ak, the predicate i_with(policy, name) enforces quantity_of(...) == 1, implicitly assuming a singleton asset. This constraint is not reflected in the function name, signature, or documentation.

To Reproduce

  1. Use i_with(policy, name) from cocktail/vodka_inputs.ak to filter or group inputs
  2. Provide an input containing the specified PolicyId and AssetName with quantity > 1
  3. Observe that the input is excluded despite containing the asset

Expected behavior
Either:

  • i_with(policy, name) should match any input containing the asset (quantity > 0), or

  • the API should be split into two explicit helpers:

    • a generic i_with(...) (quantity > 0)
    • a clearly named singleton-specific helper (e.g. i_with_singleton(...) or i_with_exactly_one(...))

Screenshots
N/A

Station (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context
Making the singleton assumption explicit via naming or function split would reduce semantic ambiguity and improve composability when working with fungible assets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions