difftreelog
test fix typo in createAccounts
in: master
2 files changed
tests/src/addCollectionAdmin.test.tsdiffbeforeafterboth33describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {33describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {34 it('Add collection admin.', async () => {34 it('Add collection admin.', async () => {35 await usingPlaygrounds(async (helper) => {35 await usingPlaygrounds(async (helper) => {36 const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n], donor);36 const [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);37 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});37 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});383839 const collection = await helper.collection.getData(collectionId);39 const collection = await helper.collection.getData(collectionId);50describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {50describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {51 it("Not owner can't add collection admin.", async () => {51 it("Not owner can't add collection admin.", async () => {52 await usingPlaygrounds(async (helper) => {52 await usingPlaygrounds(async (helper) => {53 const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor);53 const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);54 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});54 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});555556 const collection = await helper.collection.getData(collectionId);56 const collection = await helper.collection.getData(collectionId);696970 it("Admin can't add collection admin.", async () => {70 it("Admin can't add collection admin.", async () => {71 await usingPlaygrounds(async (helper) => {71 await usingPlaygrounds(async (helper) => {72 const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor);72 const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);73 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});73 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});747475 await collection.addAdmin(alice, {Substrate: bob.address});75 await collection.addAdmin(alice, {Substrate: bob.address});888889 it("Can't add collection admin of not existing collection.", async () => {89 it("Can't add collection admin of not existing collection.", async () => {90 await usingPlaygrounds(async (helper) => {90 await usingPlaygrounds(async (helper) => {91 const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor);91 const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);92 // tslint:disable-next-line: no-bitwise92 // tslint:disable-next-line: no-bitwise93 const collectionId = (1 << 32) - 1;93 const collectionId = (1 << 32) - 1;9494102102103 it("Can't add an admin to a destroyed collection.", async () => {103 it("Can't add an admin to a destroyed collection.", async () => {104 await usingPlaygrounds(async (helper) => {104 await usingPlaygrounds(async (helper) => {105 const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor);105 const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);106 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});106 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});107107108 await collection.burn(alice);108 await collection.burn(alice);116116117 it('Add an admin to a collection that has reached the maximum number of admins limit', async () => {117 it('Add an admin to a collection that has reached the maximum number of admins limit', async () => {118 await usingPlaygrounds(async (helper) => {118 await usingPlaygrounds(async (helper) => {119 const [alice, ...accounts] = await helper.arrange.creteAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor);119 const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor);120 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});120 const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'});121121122 const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber();122 const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber();tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth70 * @returns array of newly created accounts70 * @returns array of newly created accounts71 * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); 71 * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); 72 */72 */73 creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {73 createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {74 let nonce = await this.helper.chain.getNonce(donor.address);74 let nonce = await this.helper.chain.getNonce(donor.address);75 const tokenNominal = this.helper.balance.getOneTokenNominal();75 const tokenNominal = this.helper.balance.getOneTokenNominal();76 const transactions = [];76 const transactions = [];