git.delta.rocks / unique-network / refs/commits / aad19f6d0d74

difftreelog

Fix tests

Trubnikov Sergey2022-06-10parent: #c07e1d7.patch.diff
in: master

3 files changed

modifiedtests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth
51 .send();51 .send();
52 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);52 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
5353
54 const newAdmin = privateKey('//Alice');54 const newAdmin = privateKeyWrapper('//Alice');
55 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);55 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
56 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();56 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();
5757
180 .send();180 .send();
181 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);181 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
182182
183 const newAdmin = privateKey('//Alice');183 const newAdmin = privateKeyWrapper('//Alice');
184 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);184 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
185 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();185 await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send();
186 {186 {
255 .send();255 .send();
256 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);256 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
257257
258 const adminSub = privateKey('//Alice');258 const adminSub = privateKeyWrapper('//Alice');
259 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);259 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
260 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();260 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();
261 const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);261 const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
280 .send();280 .send();
281 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);281 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
282282
283 const adminSub = privateKey('//Alice');283 const adminSub = privateKeyWrapper('//Alice');
284 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);284 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
285 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();285 await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();
286 const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);286 const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
modifiedtests/src/nesting/graphs.test.tsdiffbeforeafterboth
--- 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<number> {
-  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}})}));
modifiedtests/src/nesting/rules-smoke.test.tsdiffbeforeafterboth
--- 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$/);
     });
   });
 });