mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 16:07:57 +00:00
[NFTs] Track item's metadata depositor (#13124)
* Refactor do_mint() * Track the depositor of item's metadata * Revert back the access control * On collection destroy return the metadata deposit * Clear the metadata on item burn returning the deposit * Address comments * Fix clippy * Don't return Ok on non-existing attribute removal
This commit is contained in:
@@ -608,7 +608,7 @@ fn set_item_metadata_should_work() {
|
||||
);
|
||||
assert_noop!(
|
||||
Nfts::clear_metadata(RuntimeOrigin::signed(1), 1, 42),
|
||||
Error::<Test>::UnknownCollection,
|
||||
Error::<Test>::MetadataNotFound,
|
||||
);
|
||||
assert_ok!(Nfts::clear_metadata(RuntimeOrigin::root(), 0, 42));
|
||||
assert!(!ItemMetadataOf::<Test>::contains_key(0, 42));
|
||||
@@ -1267,7 +1267,7 @@ fn burn_works() {
|
||||
|
||||
assert_noop!(
|
||||
Nfts::burn(RuntimeOrigin::signed(5), 0, 42, Some(5)),
|
||||
Error::<Test>::UnknownCollection
|
||||
Error::<Test>::UnknownItem
|
||||
);
|
||||
|
||||
assert_ok!(Nfts::force_mint(RuntimeOrigin::signed(2), 0, 42, 5, default_item_config()));
|
||||
|
||||
Reference in New Issue
Block a user