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

difftreelog

test fix for updated frontier payment logic

Yaroslav Bolyukin2023-06-05parent: #59b0444.patch.diff
in: master

9 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
1122 packageslockfile v3
modifiedtests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -555,7 +555,7 @@
     const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner,'Sponsor collection', '1', '1', '');
 
     const collectionSub = helper.rft.getCollectionObject(collectionId);
-    const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner, false);
+    const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner, false);
     // Set collection sponsor:
     expect(await collectionEvm.methods.hasCollectionPendingSponsor().call()).to.be.false;
     await collectionEvm.methods.setCollectionSponsorCross(sponsorCross).send();
@@ -592,8 +592,7 @@
         tokenId: '1',
       },
     });
-    // FIXME: doesn't work
-    expect(await collectionEvm.methods.tokenURI(tokenId).call({from: user})).to.be.equal('Test URI');
+    expect(await collectionEvm.methods.tokenURI(tokenId).call()).to.be.equal('Test URI');
 
     const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
     expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);
modifiedtests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -199,10 +199,9 @@
   // Soft-deprecated
   itEth('(!negative test!) [eth] Check owner', async ({helper}) => {
     const owner = await helper.eth.createAccountWithBalance(donor);
-    // FIXME: do not give balance
-    const malfeasant = await helper.eth.createAccountWithBalance(donor);
+    const malfeasant = helper.eth.createAccount();
     const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Transgressed', 'absolutely anything', 'COR');
-    const malfeasantCollection = await helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant, true);
+    const malfeasantCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant, true);
     const EXPECTED_ERROR = 'NoPermission';
     {
       const sponsor = await helper.eth.createAccountWithBalance(donor);
modifiedtests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -63,8 +63,7 @@
     const baseUri = 'BaseURI';
 
     const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, name, description, prefix, baseUri);
-    // FIXME: caller is not needed
-    const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+    const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
 
     const collection = helper.rft.getCollectionObject(collectionId);
     const data = (await collection.getData())!;
modifiedtests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -170,7 +170,7 @@
     const rftTokenAddress = result.events.Fractionalized.returnValues._rftToken;
 
     // FIXME: should work without the caller
-    const rftTokenContract = await helper.ethNativeContract.rftToken(rftTokenAddress, owner);
+    const rftTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress);
     expect(await rftTokenContract.methods.balanceOf(owner).call()).to.equal('100');
   });
 
modifiedtests/src/eth/nativeRpc/estimateGas.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nativeRpc/estimateGas.test.ts
+++ b/tests/src/eth/nativeRpc/estimateGas.test.ts
@@ -28,7 +28,7 @@
     });
   });
 
-  itEth.skip('estimate gas', async ({helper}) => {
+  itEth('estimate gas', async ({helper}) => {
     const BALANCE = 100n;
     const BALANCE_TO_TRANSFER = 90n;
 
@@ -57,6 +57,6 @@
       maxFeePerGas: '0x14c9338c61d',
     });
 
-    expect(estimateGas).to.be.greaterThan(40000).and.to.be.lessThan(60000);
+    expect(estimateGas).to.be.greaterThan(35000).and.to.be.lessThan(50000);
   });
 });
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -928,8 +928,7 @@
   });
 
   itEth('Returns collection name', async ({helper}) => {
-    // FIXME: should not have balance to use .call()
-    const caller = await helper.eth.createAccountWithBalance(donor);
+    const caller = helper.eth.createAccount();
     const tokenPropertyPermissions = [{
       key: 'URI',
       permission: {
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -679,8 +679,7 @@
   });
 
   itEth('Returns collection name', async ({helper}) => {
-    // FIXME: should not have balance to use .call()
-    const caller = await helper.eth.createAccountWithBalance(alice);
+    const caller = helper.eth.createAccount();
     const tokenPropertyPermissions = [{
       key: 'URI',
       permission: {
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -315,8 +315,7 @@
     }));
 
   itEth('Can be read', async({helper}) => {
-    // FIXME: User with no balance should be able to call
-    const caller = await helper.eth.createAccountWithBalance(alice);
+    const caller = helper.eth.createAccount();
     const collection = await helper.nft.mintCollection(alice, {
       tokenPropertyPermissions: [{
         key: 'testKey',