git.delta.rocks / unique-network / refs/commits / 256ba30ca971

difftreelog

Add fungible collections checks

Max Andreev2022-12-05parent: #185ad36.patch.diff
in: master

2 files changed

modifiedtests/src/eth/createFTCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createFTCollection.test.ts
+++ b/tests/src/eth/createFTCollection.test.ts
@@ -215,12 +215,15 @@
     }
   });
   
-  itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {
+  itEth('(!negative test!) cannot create collection if value !== 2', async ({helper}) => {
     const owner = await helper.eth.createAccountWithBalance(donor);
     const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
-    await expect(collectionHelper.methods
-      .createFTCollection('Peasantry', DECIMALS, 'absolutely anything', 'TWIW')
-      .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
+    const expects = [0n, 1n, 30n].map(async value => {
+      await expect(collectionHelper.methods
+        .createFTCollection('Peasantry', DECIMALS, 'absolutely anything', 'TWIW')
+        .call({value: Number(value * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
+    });
+    await Promise.all(expects);
   });
 
   // Soft-deprecated
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
413 }413 }
414 });414 });
415415
416 itEth('Cannot transferCross with invalid params', async ({helper}) => {416 itEth.skip('Cannot transferCross with invalid params', async ({helper}) => {
417 const sender = await helper.eth.createAccountWithBalance(donor);417 const sender = await helper.eth.createAccountWithBalance(donor);
418 const tokenOwner = await helper.eth.createAccountWithBalance(donor);418 const tokenOwner = await helper.eth.createAccountWithBalance(donor);
419 const receiverCrossSub = helper.ethCrossAccount.fromKeyringPair(minter);419 const receiverCrossSub = helper.ethCrossAccount.fromKeyringPair(minter);