--- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -665,6 +665,7 @@ // Anyone can create a collection let who = ensure_signed(origin)?; + // Take a (non-refundable) deposit of collection creation let mut imbalance = <<::Currency as Currency>::PositiveImbalance>::zero(); imbalance.subsume(<::Currency as Currency>::deposit_creating( &T::TreasuryAccountId::get(), --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -25,6 +25,7 @@ const Treasury = "5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z"; const saneMinimumFee = 0.05; const saneMaximumFee = 0.5; +const createCollectionDeposit = 100; let alice: IKeyringPair; let bob: IKeyringPair; @@ -127,8 +128,8 @@ const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString()); const fee = aliceBalanceBefore.minus(aliceBalanceAfter); - expect(fee.dividedBy(1e15).toNumber()).to.be.lessThan(saneMaximumFee); - expect(fee.dividedBy(1e15).toNumber()).to.be.greaterThan(saneMinimumFee); + expect(fee.dividedBy(1e15).toNumber()).to.be.lessThan(saneMaximumFee + createCollectionDeposit); + expect(fee.dividedBy(1e15).toNumber()).to.be.greaterThan(saneMinimumFee + createCollectionDeposit); }); });