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
435 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);435 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
436 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth);436 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth);
437437
438 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;438 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
439 expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;439 expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
440440
441 await collection.mint(alice, 100n, {Ethereum: owner.eth});441 await collection.mint(alice, 100n, {Ethereum: owner.eth});
442 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;442 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
443 expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;443 expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
444444
445 await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});445 await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});
446 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true;446 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50');
447 expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true;447 expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50');
448448
449 await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});449 await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth});
450 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;450 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
451 expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true;451 expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100');
452452
453 await collectionEvm.methods.transferCross(owner, 100n).send({from: other.eth});453 await collectionEvm.methods.transferCross(owner, 100n).send({from: other.eth});
454 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;454 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
455 expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;455 expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
456 });456 });
457});457});
458458
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
591 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);591 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
592 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth);592 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth);
593593
594 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;594 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
595595
596 for (let i = 1n; i < 10n; i++) {596 for (let i = 1n; i < 10n; i++) {
597 await collection.mintToken(minter, 100n, {Ethereum: owner.eth});597 await collection.mintToken(minter, 100n, {Ethereum: owner.eth});
598 expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true;598 expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq(i.toString());
599 }599 }
600 });600 });
601601
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
475 const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);475 const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId);
476 const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth);476 const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth);
477477
478 expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 200n).to.be.true;478 expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('200');
479 expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;479 expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
480480
481 await tokenContract.methods.repartition(100n).send({from: owner.eth});481 await tokenContract.methods.repartition(100n).send({from: owner.eth});
482 expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true;482 expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100');
483 expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true;483 expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0');
484484
485 await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});485 await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});
486 expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true;486 expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50');
487 expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true;487 expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50');
488488
489 await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});489 await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth});
490 expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true;490 expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0');
491 expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true;491 expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100');
492492
493 await tokenContract.methods.repartition(1000n).send({from: other.eth});493 await tokenContract.methods.repartition(1000n).send({from: other.eth});
494 await tokenContract.methods.transferCross(owner, 500n).send({from: other.eth});494 await tokenContract.methods.transferCross(owner, 500n).send({from: other.eth});
495 expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 500n).to.be.true;495 expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('500');
496 expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 500n).to.be.true;496 expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('500');
497 });497 });
498});498});
499499