git.delta.rocks / unique-network / refs/commits / 7a7b4a5ca2fe

difftreelog

test fix typo in createAccounts

Fahrrader2022-08-31parent: #c13f6a0.patch.diff
in: master

2 files changed

modifiedtests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
33describe('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'});
3838
39 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'});
5555
56 const collection = await helper.collection.getData(collectionId);56 const collection = await helper.collection.getData(collectionId);
6969
70 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'});
7474
75 await collection.addAdmin(alice, {Substrate: bob.address});75 await collection.addAdmin(alice, {Substrate: bob.address});
8888
89 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-bitwise
93 const collectionId = (1 << 32) - 1;93 const collectionId = (1 << 32) - 1;
9494
102102
103 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'});
107107
108 await collection.burn(alice);108 await collection.burn(alice);
116116
117 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'});
121121
122 const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber();122 const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber();
modifiedtests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth
--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -70,7 +70,7 @@
    * @returns array of newly created accounts
    * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); 
    */
-  creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {
+  createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {
     let nonce = await this.helper.chain.getNonce(donor.address);
     const tokenNominal = this.helper.balance.getOneTokenNominal();
     const transactions = [];