From 239c99e5ac3303a523d2a5bd83d77d919200ea29 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH] chore: test with wrong fee for collection creation --- --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -171,6 +171,26 @@ expect(finalContractBalance == initialContractBalance).to.be.true; }); + itEth('Negative test: call createNFTCollection with wrong fee', async({helper}) => { + const SMALL_FEE = 1n * helper.balance.getOneTokenNominal(); + const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); + const caller = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); + + await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + }); + + itEth('Negative test: call createRFTCollection with wrong fee', async({helper}) => { + const SMALL_FEE = 1n * helper.balance.getOneTokenNominal(); + const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); + const caller = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); + + await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + }); + itEth('Get collection creation fee', async({helper}) => { const deployer = await helper.eth.createAccountWithBalance(donor); expect(await helper.eth.getCollectionCreationFee(deployer)).to.be.equal(String(2n * helper.balance.getOneTokenNominal())); -- gitstuff