From aad19f6d0d74b9359960899197c31546d1a2bb03 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 10 Jun 2022 16:39:05 +0000 Subject: [PATCH] Fix tests --- --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -51,7 +51,7 @@ .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = privateKey('//Alice'); + const newAdmin = privateKeyWrapper('//Alice'); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); @@ -180,7 +180,7 @@ .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = privateKey('//Alice'); + const newAdmin = privateKeyWrapper('//Alice'); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); { @@ -255,7 +255,7 @@ .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const adminSub = privateKey('//Alice'); + const adminSub = privateKeyWrapper('//Alice'); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -280,7 +280,7 @@ .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const adminSub = privateKey('//Alice'); + const adminSub = privateKeyWrapper('//Alice'); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -13,7 +13,7 @@ * ``` */ async function buildComplexObjectGraph(api: ApiPromise, sender: IKeyringPair): Promise { - const events = await executeTransaction(api, sender, api.tx.unique.createCollectionEx({mode: 'NFT', permissions: {nesting: 'Owner'}})); + const events = await executeTransaction(api, sender, api.tx.unique.createCollectionEx({mode: 'NFT', permissions: {nesting: {tokenOwner: true}}})); const {collectionId} = getCreateCollectionResult(events); await executeTransaction(api, sender, api.tx.unique.createMultipleItemsEx(collectionId, {NFT: Array(8).fill({owner: {Substrate: sender.address}})})); --- a/tests/src/nesting/rules-smoke.test.ts +++ b/tests/src/nesting/rules-smoke.test.ts @@ -27,11 +27,11 @@ await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible',decimalPoints:0}}); await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {Fungible: {Value: 1}}))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); await createFungibleItemExpectSuccess(alice, collection, {Value:1n}, {Substrate: alice.address}); await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, 0, 1n))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); }); }); @@ -39,11 +39,11 @@ await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {properties: []}}))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); }); }); @@ -51,11 +51,11 @@ await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}}))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address}); await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n))) - .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/); + .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); }); }); }); -- gitstuff