difftreelog
bug fix
in: master
1 file changed
tests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth67 });67 });68 });68 });696970 it('Remove admin from collection that has reached the maximum number of admins limit', async () => {70 it('Remove admin from collection that has no admins', async () => {71 await usingApi(async (api: ApiPromise) => {71 await usingApi(async (api: ApiPromise) => {72 const Alice = privateKey('//Alice');72 const Alice = privateKey('//Alice');73 const accounts = [74 'GsvVmjr1CBHwQHw84pPHMDxgNY3iBLz6Qn7qS3CH8qPhrHz',75 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP',76 'JKspFU6ohf1Grg3Phdzj2pSgWvsYWzSfKghhfzMbdhNBWs5',77 'JKspFU6ohf1Grg3Phdzj2pSgWvsYWzSfKghhfzMbdhNBWs5',78 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P',79 'DfnTB4z7eUvYRqcGtTpFsLC69o6tvBSC1pEv8vWPZFtCkaK',80 'HnMAUz7r2G8G3hB27SYNyit5aJmh2a5P4eMdDtACtMFDbam',81 'DE14BzQ1bDXWPKeLoAqdLAm1GpyAWaWF1knF74cEZeomTBM',82 ];83 const collectionId = await createCollectionExpectSuccess();73 const collectionId = await createCollectionExpectSuccess();847485 const chainLimit = await api.query.nft.chainLimit() as unknown as { collections_admins_limit: BN };86 const chainLimitNumber = chainLimit.collections_admins_limit.toNumber();87 expect(chainLimitNumber).to.be.equal(5);8889 for (let i = 0; i < chainLimitNumber - 1; i++) {90 const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, accounts[i]);91 await submitTransactionAsync(Alice, changeAdminTx);92 const adminListAfterAddAdmin: any = (await api.query.nft.adminList(collectionId));75 const adminListBeforeAddAdmin: any = (await api.query.nft.adminList(collectionId));93 expect(adminListAfterAddAdmin).to.be.contains(accounts[i]);76 expect(adminListBeforeAddAdmin).to.have.lengthOf(0);94 }957796 const tx = api.tx.nft.removeCollectionAdmin(collectionId, accounts[1]);78 const tx = api.tx.nft.removeCollectionAdmin(collectionId, Alice.address);97 await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;79 await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;98 });80 });99 });81 });