git.delta.rocks / unique-network / refs/commits / 7445bbe5b1ba

difftreelog

fix tests

Trubnikov Sergey2023-04-18parent: #29762d9.patch.diff
in: master

4 files changed

modifiedtests/src/eth/fungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -435,24 +435,24 @@
     const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
     const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth);
 
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
+    expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
 
     await collection.mint(alice, 100n, {Ethereum: owner.eth});
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
+    expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
 
     await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true;
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50');
+    expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50');
 
     await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
+    expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100');
 
     await collectionEvm.methods.transferCross(owner, 100n).send({from: other.eth});
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
+    expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
   });
 });
 
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
669 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);669 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
670 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth);670 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth);
671671
672 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;672 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
673673
674 for (let i = 1n; i < 10n; i++) {674 for (let i = 1; i < 10; i++) {
675 await collection.mintToken(minter, {Ethereum: owner.eth});675 await collection.mintToken(minter, {Ethereum: owner.eth});
676 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true;676 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq(i.toString());
677 }677 }
678 });678 });
679679
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -591,11 +591,11 @@
     const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
     const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth);
 
-    expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
 
     for (let i = 1n; i < 10n; i++) {
       await collection.mintToken(minter, 100n, {Ethereum: owner.eth});
-      expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true;
+      expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq(i.toString());
     }
   });
 
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -475,25 +475,25 @@
     const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
     const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth);
 
-    expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 200n).to.be.true;
-    expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('200');
+    expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
 
     await tokenContract.methods.repartition(100n).send({from: owner.eth});
-    expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;
-    expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;
+    expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
+    expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
 
     await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});
-    expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true;
-    expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true;
+    expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50');
+    expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50');
 
     await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});
-    expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;
-    expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true;
+    expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
+    expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100');
 
     await tokenContract.methods.repartition(1000n).send({from: other.eth});
     await tokenContract.methods.transferCross(owner, 500n).send({from: other.eth});
-    expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 500n).to.be.true;
-    expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 500n).to.be.true;
+    expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('500');
+    expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('500');
   });
 });