From 99c2d03b952773c8e6486855dfc07b1a77bcfc47 Mon Sep 17 00:00:00 2001 From: Andrey Kuznetsov Date: Mon, 30 May 2022 11:12:25 +0000 Subject: [PATCH] Fix mintMode and access for tests --- --- 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; }); }); --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1364,7 +1364,7 @@ export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) { await usingApi(async (api) => { // Run the transaction - const tx = api.tx.unique.setMintPermission(collectionId, enabled); + const tx = api.tx.unique.setCollectionPermissions(collectionId, {mintMode: enabled}); const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; const result = getCreateCollectionResult(events); // tslint:disable-next-line:no-unused-expression -- gitstuff