Skip to content

nfts: lock_item_properties emits misleading events when no state changes occur #9215

@Maksandre

Description

@Maksandre

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

If an item's metadata or attributes are "locked", they cannot be "unlocked" later:

/// When the metadata or attributes are locked, it won't be possible the unlock them.
.

However, the ItemPropertiesLocked event is emitted with parameters that mirror the input values rather than the actual state changes.

When executing lock_item_properties on an item with already locked metadata or attributes, and setting lock_metadata or lock_attributes to false:

  1. The locked values stay locked, which is correct
  2. The transaction succeeds, which is controversial
  3. The ItemPropertiesLocked event indicates an unlocked state, which is misleading

Steps to reproduce

  1. Create a collection with default settings
  2. Create an item for a collection
  3. Execute lockItemProperties - set true for lockMetadata and lockAttributes
  4. Execute lockItemProperties - set false for lockMetadata and lockAttributes

Check that the ItemPropertiesLocked event is emitted with lockMetadata: false and lockAttributes: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    I10-unconfirmedIssue might be valid, but it's not yet known.I2-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions