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

difftreelog

fix PR commets

Trubnikov Sergey2023-05-17parent: #3429f32.patch.diff
in: master

4 files changed

modifiedtests/src/eth/nativeFungible.test.tsdiffbeforeafterboth
24 before(async function() {24 before(async function() {
25 await usingEthPlaygrounds(async (helper, privateKey) => {25 await usingEthPlaygrounds(async (helper, privateKey) => {
26 donor = await privateKey({url: import.meta.url});26 donor = await privateKey({url: import.meta.url});
27 // [alice] = await helper.arrange.createAccounts([30n], donor);
28 });27 });
29 });28 });
3029
101 const balanceReceiverAfter = await helper.balance.getEthereum(receiver);100 const balanceReceiverAfter = await helper.balance.getEthereum(receiver);
102101
103 expect(balanceOwnerBefore - 50n > balanceOwnerAfter).to.be.true;102 expect(balanceOwnerBefore - 50n > balanceOwnerAfter).to.be.true;
104 expect(balanceReceiverBefore === balanceReceiverAfter - 50n).to.be.true;103 expect(balanceReceiverBefore + 50n).to.be.equal(balanceReceiverAfter);
105 });104 });
106105
107 itEth('transferFrom()', async ({helper}) => {106 itEth('transferFrom()', async ({helper}) => {
131 before(async function() {130 before(async function() {
132 await usingEthPlaygrounds(async (helper, privateKey) => {131 await usingEthPlaygrounds(async (helper, privateKey) => {
133 donor = await privateKey({url: import.meta.url});132 donor = await privateKey({url: import.meta.url});
134 // [alice] = await helper.arrange.createAccounts([30n], donor);
135 });133 });
136 });134 });
137135
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
142142
143 async collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false) {143 async collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false) {
144 let abi;144 let abi;
145 if (address === '0x17C4e6453cC49aaAAEaCA894E6d9683e00000000') {145 if (address === this.helper.ethAddress.fromCollectionId(0)) {
146 abi = nativeFungibleAbi;146 abi = nativeFungibleAbi;
147 } else {147 } else {
148 abi ={148 abi ={
modifiedtests/src/sub/nesting/common.test.tsdiffbeforeafterboth
103 nesting: {tokenOwner: true, restricted: testCase.restrictedMode ? [collectionForNesting.collectionId] : null},103 nesting: {tokenOwner: true, restricted: testCase.restrictedMode ? [collectionForNesting.collectionId] : null},
104 });104 });
105105
106 // Alice can mint and nest token:106 // Bob can nest Native FT into their NFT:
107 await collectionForNesting.transfer(bob, targetTokenBob.nestingAccount(), 50n);107 await collectionForNesting.transfer(bob, targetTokenBob.nestingAccount(), 50n);
108 expect(await collectionForNesting.getBalance(targetTokenBob.nestingAccount())).eq(50n);108 expect(await collectionForNesting.getBalance(targetTokenBob.nestingAccount())).eq(50n);
109 });109 });
modifiedtests/src/sub/nesting/nesting.negative.test.tsdiffbeforeafterboth
69 ? collectionForNesting.mint(alice, 100n, targetToken.nestingAccount())69 ? collectionForNesting.mint(alice, 100n, targetToken.nestingAccount())
70 : collectionForNesting.transfer(alice, targetToken.nestingAccount(), 100n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');70 : collectionForNesting.transfer(alice, targetToken.nestingAccount(), 100n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');
7171
72 // Alice can mint and nest token:72 // Alice can't mint and nest tokens:
73 if (testCase.mode === 'ft') {73 if (testCase.mode === 'ft') {
74 await collectionForNesting.mint(alice, 100n);74 await collectionForNesting.mint(alice, 100n);
75 }75 }
100 case 'nft': nestedTokenBob = await (nestedCollectionBob as UniqueNFTCollection).mintToken(bob); break;100 case 'nft': nestedTokenBob = await (nestedCollectionBob as UniqueNFTCollection).mintToken(bob); break;
101 case 'rft': nestedTokenBob = await (nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n); break;101 case 'rft': nestedTokenBob = await (nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n); break;
102 case 'ft': await (nestedCollectionBob as UniqueFTCollection).mint(bob, 100n); break;102 case 'ft': await (nestedCollectionBob as UniqueFTCollection).mint(bob, 100n); break;
103 case 'native ft': break;103 case 'native ft': await expect((nestedCollectionBob as UniqueFTCollection).mint(bob, 100n)).to.be.rejectedWith('common.UnsupportedOperation'); break;
104 }104 }
105105
106 // Bob non-owner of targetToken and non admin of targetCollection, so106 // Bob non-owner of targetToken and non admin of targetCollection, so
109 case 'nft': await expect((nestedCollectionBob as UniqueNFTCollection).mintToken(bob, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;109 case 'nft': await expect((nestedCollectionBob as UniqueNFTCollection).mintToken(bob, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
110 case 'rft': await expect((nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;110 case 'rft': await expect((nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
111 case 'ft': await expect((nestedCollectionBob as UniqueFTCollection).mint(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;111 case 'ft': await expect((nestedCollectionBob as UniqueFTCollection).mint(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
112 case 'native ft': break;112 case 'native ft': await expect((nestedCollectionBob as UniqueFTCollection).mint(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UnsupportedOperation'); break;
113 }113 }
114114
115 // 2. cannot nest existing token:115 // 2. cannot nest existing token: