difftreelog
Add checks to removeCollectionAdminCross
in: master
1 file changed
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth239 const owner = await helper.eth.createAccountWithBalance(donor);239 const owner = await helper.eth.createAccountWithBalance(donor);240 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');240 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');241241242 const [newAdmin] = await helper.arrange.createAccounts([10n], donor);242 const [adminSub] = await helper.arrange.createAccounts([10n], donor);243 const adminEth = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();243 const newAdminCross = helper.ethCrossAccount.fromKeyringPair(newAdmin);244 const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);245 const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);246244 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);247 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);245 await collectionEvm.methods.addCollectionAdminCross(newAdminCross).send();248 await collectionEvm.methods.addCollectionAdminCross(adminCrossSub).send();249 await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();250246 {251 {247 const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]);252 const adminList = await helper.collection.getAdmins(collectionId);248 expect(adminList[0].asSubstrate.toString().toLocaleLowerCase())253 expect(adminList).to.deep.include({Substrate: adminSub.address});249 .to.be.eq(newAdmin.address.toLocaleLowerCase());254 expect(adminList).to.deep.include({Ethereum: adminEth});250 }255 }251256252 await collectionEvm.methods.removeCollectionAdminCross(newAdminCross).send();257 await collectionEvm.methods.removeCollectionAdminCross(adminCrossSub).send();258 await collectionEvm.methods.removeCollectionAdminCross(adminCrossEth).send();253 const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]);259 const adminList = await helper.collection.getAdmins(collectionId);254 expect(adminList.length).to.be.eq(0);260 expect(adminList.length).to.be.eq(0);261262 // Non admin cannot mint:263 await expect(helper.nft.mintToken(adminSub, {collectionId, owner: {Substrate: adminSub.address}})).to.be.rejectedWith(/common.PublicMintingNotAllowed/);264 await expect(collectionEvm.methods.mint(adminEth).send({from: adminEth})).to.be.rejected;255 });265 });256266257 // Soft-deprecated267 // Soft-deprecated