Skip to content

Potentially problematic *_nft_* function naming #121

@rober-m

Description

@rober-m

The names of these recently added functions:

has_any_nft(self: Value, policy: PolicyId) -> Bool

has_any_nft_strict(self: Value, policy: PolicyId) -> Bool

has_nft(self: Value, policy: PolicyId, asset_name: AssetName) -> Bool

has_nft_strict(self: Value, policy: PolicyId, asset_name: AssetName) -> Bool

Implicitly assume tokens that are unique at the UTxO level are also unique at the blockchain level.

This could be problematic or confusing for inexperienced Cardano developers and for experienced devs who could use it to check for fungible tokens that should be unique per UTxO.

Would it be ok to rename them to something like this (and update the docs)?:

has_any_unique(self: Value, policy: PolicyId) -> Bool

has_any_unique_strict(self: Value, policy: PolicyId) -> Bool

has_unique(self: Value, policy: PolicyId, asset_name: AssetName) -> Bool

has_unique_strict(self: Value, policy: PolicyId, asset_name: AssetName) -> Bool

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