git.delta.rocks / unique-network / refs/commits / 980a35f96807

difftreelog

fix tests

Igor Kozyrev2022-03-01parent: #72387e3.patch.diff
in: master

1 file changed

modifiedtests/src/transfer.test.tsdiffbeforeafterboth
306 const alice = privateKey('//Alice');306 const alice = privateKey('//Alice');
307 const aliceProxy = subToEth(alice.address);307 const aliceProxy = subToEth(alice.address);
308 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});308 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
309 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'ReFungible');309 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'Fungible');
310 const balanceAliceBefore = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId);310 const balanceAliceBefore = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId);
311 await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, {Ethereum: aliceProxy}, 10, 'ReFungible');311 await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, {Ethereum: aliceProxy}, 10, 'Fungible');
312 const balanceAliceAfter = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId);312 const balanceAliceAfter = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId);
313 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);313 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
314 });314 });
319 const aliceProxy = subToEth(alice.address);319 const aliceProxy = subToEth(alice.address);
320 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});320 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
321 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);321 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
322 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy} , 10, 'ReFungible');322 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy} , 10, 'Fungible');
323 await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, alice, 10, 'ReFungible');323 await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, alice, 10, 'Fungible');
324 const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);324 const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
325 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);325 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
326 });326 });
330 const alice = privateKey('//Alice');330 const alice = privateKey('//Alice');
331 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});331 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
332 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);332 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
333 await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'ReFungible');333 await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'Fungible');
334 await transferFromExpectSuccess(collectionId, tokenId, alice, alice, alice, 10, 'ReFungible');334 await transferFromExpectSuccess(collectionId, tokenId, alice, alice, alice, 10, 'Fungible');
335 const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);335 const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
336 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);336 expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
337 });337 });