substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Nfts: Fix Auto-Increment

Open Szegoo opened this issue 3 years ago • 6 comments

Fixes #11796

The Idea

As mentioned in the discussion in the previous PR that tried to implement this issue we cannot assume that the CollectionId is an integer hence parachains that support XCM will have CollectionId defined as Multilocation. To solve this in this PR I have added a new trait Incrementable that needs to be implemented for the CollectionId type. This way the incrementing functionality needs to be defined in the runtime so that we don't make any assumptions here on substrate.

Szegoo avatar Sep 08 '22 17:09 Szegoo

WIP

Szegoo avatar Sep 08 '22 17:09 Szegoo

@KiChjang @jsidorenko Could you review this?

Szegoo avatar Sep 10 '22 14:09 Szegoo

Removed the try_increment_id function, not sure why the CI checks are getting errored now :/

Szegoo avatar Sep 13 '22 13:09 Szegoo

The CI checks are failing because the Event and Call got renamed, I will open a small PR to fix that in this branch.

Szegoo avatar Sep 15 '22 05:09 Szegoo

@Szegoo No need, I'm merging master and fixing them along the way. It should work with the latest push now.

KiChjang avatar Sep 15 '22 05:09 KiChjang

@KiChjang You should also rename the Event inside the runtime implementation of the nfts pallet.

Szegoo avatar Sep 15 '22 05:09 Szegoo

bot merge

KiChjang avatar Sep 23 '22 08:09 KiChjang