difftreelog
Fix fee sanity test
in: master
2 files changed
pallets/nft/src/lib.rsdiffbeforeafterboth665 // Anyone can create a collection665 // Anyone can create a collection666 let who = ensure_signed(origin)?;666 let who = ensure_signed(origin)?;667667668 // Take a (non-refundable) deposit of collection creation668 let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();669 let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();669 imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(670 imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(670 &T::TreasuryAccountId::get(),671 &T::TreasuryAccountId::get(),tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth--- 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);
});
});