Skip to content

Commit bb505e6

Browse files
authored
Merge pull request #215 from rmrk-team/bug/208-locked-collection-allow-minting-after-burn
fix issue 208 allow minting after burn
2 parents 6485ffd + b7e011b commit bb505e6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pallets/rmrk-core/src/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ where
329329
) -> Result<CollectionId, DispatchError> {
330330
Collections::<T>::try_mutate_exists(collection_id, |collection| -> DispatchResult {
331331
let collection = collection.as_mut().ok_or(Error::<T>::CollectionUnknown)?;
332-
collection.max = Some(collection.nfts_count);
332+
collection.max = Some(0);
333333
Ok(())
334334
})?;
335335

pallets/rmrk-core/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ fn lock_collection_works() {
145145
assert_ok!(RMRKCore::burn_nft(Origin::signed(ALICE), COLLECTION_ID_0, NFT_ID_0, MAX_BURNS));
146146
// Should now have only three NFTS in collection
147147
assert_eq!(RMRKCore::collections(COLLECTION_ID_0).unwrap().nfts_count, 3);
148-
// Still we should be unable to mint another NFT
149-
assert_ok!(basic_mint(5));
148+
// After burning, we should still be unable to mint another NFT
149+
assert_noop!(basic_mint(5), Error::<Test>::CollectionFullOrLocked);
150150
});
151151
}
152152

tests/src/util/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ export async function lockCollection(
900900

901901
await getCollection(api, collectionId).then((collectionOption) => {
902902
const collection = collectionOption.unwrap();
903-
expect(collection.max.unwrap().toNumber()).to.be.equal(max);
903+
expect(collection.max.unwrap().toNumber()).to.be.equal(0);
904904
});
905905
}
906906

0 commit comments

Comments
 (0)