git.delta.rocks / unique-network / refs/commits / 99c2d03b9527

difftreelog

Fix mintMode and access for tests

Andrey Kuznetsov2022-05-30parent: #7cf62e7.patch.diff
in: master

2 files changed

modifiedtests/src/setPublicAccessMode.test.tsdiffbeforeafterboth
--- a/tests/src/setPublicAccessMode.test.ts
+++ b/tests/src/setPublicAccessMode.test.ts
@@ -73,7 +73,7 @@
     await usingApi(async (api: ApiPromise) => {
       // tslint:disable-next-line: radix
       const collectionId = await getCreatedCollectionCount(api) + 1;
-      const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
+      const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'});
       await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
     });
   });
@@ -83,7 +83,7 @@
       // tslint:disable-next-line: no-bitwise
       const collectionId = await createCollectionExpectSuccess();
       await destroyCollectionExpectSuccess(collectionId);
-      const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
+      const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'});
       await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
     });
   });
@@ -100,7 +100,7 @@
     await usingApi(async (api: ApiPromise) => {
       // tslint:disable-next-line: no-bitwise
       const collectionId = await createCollectionExpectSuccess();
-      const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
+      const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'});
       await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
     });
   });
@@ -118,7 +118,7 @@
       // tslint:disable-next-line: no-bitwise
       const collectionId = await createCollectionExpectSuccess();
       await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
-      const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
+      const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'});
       await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
     });
   });
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
1364export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) {1364export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) {
1365 await usingApi(async (api) => {1365 await usingApi(async (api) => {
1366 // Run the transaction1366 // Run the transaction
1367 const tx = api.tx.unique.setMintPermission(collectionId, enabled);1367 const tx = api.tx.unique.setCollectionPermissions(collectionId, {mintMode: enabled});
1368 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;1368 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
1369 const result = getCreateCollectionResult(events);1369 const result = getCreateCollectionResult(events);
1370 // tslint:disable-next-line:no-unused-expression1370 // tslint:disable-next-line:no-unused-expression