difftreelog
Split tests to sequential and parallel, remove Alice and friends
in: master
14 files changed
tests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterbothno changes
tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth31 });31 });32 });32 });3333 34 itEth('Create collection', async ({helper}) => {35 const owner = await helper.eth.createAccountWithBalance(donor);36 37 const name = 'CollectionEVM';38 const description = 'Some description';39 const prefix = 'token prefix';40 41 // todo:playgrounds this might fail when in async environment.42 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;4344 const {collectionId} = await helper.eth.createFungibleCollection(owner, name, DECIMALS, description, prefix);45 46 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;47 const data = (await helper.ft.getData(collectionId))!;4849 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);50 expect(collectionId).to.be.eq(collectionCountAfter);51 expect(data.name).to.be.eq(name);52 expect(data.description).to.be.eq(description);53 expect(data.raw.tokenPrefix).to.be.eq(prefix);54 expect(data.raw.mode).to.be.deep.eq({Fungible: DECIMALS.toString()});55 });5657 // todo:playgrounds this test will fail when in async environment.58 itEth('Check collection address exist', async ({helper}) => {59 const owner = await helper.eth.createAccountWithBalance(donor);6061 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;62 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);63 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);6465 expect(await collectionHelpers.methods66 .isCollectionExist(expectedCollectionAddress)67 .call()).to.be.false;6869 70 await helper.eth.createFungibleCollection(owner, 'A', DECIMALS, 'A', 'A');7172 73 expect(await collectionHelpers.methods74 .isCollectionExist(expectedCollectionAddress)75 .call()).to.be.true;76 });77 78 itEth('Set sponsorship', async ({helper}) => {34 itEth('Set sponsorship', async ({helper}) => {79 const owner = await helper.eth.createAccountWithBalance(donor);35 const owner = await helper.eth.createAccountWithBalance(donor);tests/src/eth/createNFTCollection.seqtest.tsdiffbeforeafterbothno changes
tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth28 });28 });29 });29 });3031 itEth('Create collection', async ({helper}) => {32 const owner = await helper.eth.createAccountWithBalance(donor);3334 const name = 'CollectionEVM';35 const description = 'Some description';36 const prefix = 'token prefix';3738 // todo:playgrounds this might fail when in async environment.39 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;40 const {collectionId, collectionAddress, events} = await helper.eth.createNFTCollection(owner, name, description, prefix);41 42 expect(events).to.be.deep.equal([43 {44 address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',45 event: 'CollectionCreated',46 args: {47 owner: owner,48 collectionId: collectionAddress,49 },50 },51 ]);52 53 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;5455 const collection = helper.nft.getCollectionObject(collectionId);56 const data = (await collection.getData())!;5758 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);59 expect(collectionId).to.be.eq(collectionCountAfter);60 expect(data.name).to.be.eq(name);61 expect(data.description).to.be.eq(description);62 expect(data.raw.tokenPrefix).to.be.eq(prefix);63 expect(data.raw.mode).to.be.eq('NFT');6465 const options = await collection.getOptions();6667 expect(options.tokenPropertyPermissions).to.be.empty;68 });693070 itEth('Create collection with properties', async ({helper}) => {31 itEth('Create collection with properties', async ({helper}) => {71 const owner = await helper.eth.createAccountWithBalance(donor);32 const owner = await helper.eth.createAccountWithBalance(donor);109 ]);70 ]);110 });71 });111112 // this test will occasionally fail when in async environment.113 itEth.skip('Check collection address exist', async ({helper}) => {114 const owner = await helper.eth.createAccountWithBalance(donor);115116 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;117 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);118 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);119120 expect(await collectionHelpers.methods121 .isCollectionExist(expectedCollectionAddress)122 .call()).to.be.false;123124 await collectionHelpers.methods125 .createNFTCollection('A', 'A', 'A')126 .send({value: Number(2n * helper.balance.getOneTokenNominal())});127128 expect(await collectionHelpers.methods129 .isCollectionExist(expectedCollectionAddress)130 .call()).to.be.true;131 });13272133 itEth('Set sponsorship', async ({helper}) => {73 itEth('Set sponsorship', async ({helper}) => {134 const owner = await helper.eth.createAccountWithBalance(donor);74 const owner = await helper.eth.createAccountWithBalance(donor);tests/src/eth/fungible.test.tsdiffbeforeafterboth148 }148 }149 });149 });150150151 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {151 itEth('Can perform burnFromCross()', async ({helper}) => {152 const alice = await privateKey('//Alice');153 const sender = await helper.eth.createAccountWithBalance(alice, 100n);152 const sender = await helper.eth.createAccountWithBalance(donor, 100n);154153155 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);154 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);156155261 });260 });262261263 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {262 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {264 const alice = await privateKey('//Alice');265 const sender = await helper.eth.createAccountWithBalance(alice, 100n);263 const sender = await helper.eth.createAccountWithBalance(donor, 100n);266264267 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);265 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);268266455 });453 });456454457 itEth('Events emitted for transferFromCross()', async ({helper, privateKey}) => {455 itEth('Events emitted for transferFromCross()', async ({helper, privateKey}) => {458 const alice = await privateKey('//Alice');459 const sender = await helper.eth.createAccountWithBalance(alice, 100n);456 const sender = await helper.eth.createAccountWithBalance(donor, 100n);460457461 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);458 const collection = await helper.ft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);462459tests/src/eth/migration.seqtest.tsdiffbeforeafterbothno changes
tests/src/eth/migration.test.tsdiffbeforeafterbothno changes
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth139describe('NFT: Plain calls', () => {139describe('NFT: Plain calls', () => {140 let donor: IKeyringPair;140 let donor: IKeyringPair;141 let alice: IKeyringPair;141 let alice: IKeyringPair;142 let bob: IKeyringPair;143 let charlie: IKeyringPair;142144143 before(async function() {145 before(async function() {144 await usingEthPlaygrounds(async (helper, privateKey) => {146 await usingEthPlaygrounds(async (helper, privateKey) => {145 donor = await privateKey({filename: __filename});147 donor = await privateKey({filename: __filename});146 [alice] = await helper.arrange.createAccounts([10n], donor);148 [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);147 });149 });148 });150 });149151247 });249 });248250249 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {251 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {250 const alice = await privateKey('//Alice');251 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});252 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});252253253 const owner = await privateKey('//Bob');254 const owner = bob;254 const spender = await helper.eth.createAccountWithBalance(alice, 100n);255 const spender = await helper.eth.createAccountWithBalance(donor, 100n);255256256 const token = await collection.mintToken(alice, {Substrate: owner.address});257 const token = await collection.mintToken(alice, {Substrate: owner.address});257258277 });278 });278279279 itEth('Can perform approveCross()', async ({helper, privateKey}) => {280 itEth('Can perform approveCross()', async ({helper, privateKey}) => {280 const alice = await privateKey('//Alice');281 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});281 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});282282283 const owner = await helper.eth.createAccountWithBalance(alice, 100n);283 const owner = await helper.eth.createAccountWithBalance(donor, 100n);284 const receiver = await privateKey('//Charlie');284 const receiver = charlie;285285286 const token = await collection.mintToken(alice, {Ethereum: owner});286 const token = await collection.mintToken(alice, {Ethereum: owner});287287373describe('NFT: Fees', () => {373describe('NFT: Fees', () => {374 let donor: IKeyringPair;374 let donor: IKeyringPair;375 let alice: IKeyringPair;375 let alice: IKeyringPair;376 let bob: IKeyringPair;377 let charlie: IKeyringPair;376378377 before(async function() {379 before(async function() {378 await usingEthPlaygrounds(async (helper, privateKey) => {380 await usingEthPlaygrounds(async (helper, privateKey) => {379 donor = await privateKey({filename: __filename});381 donor = await privateKey({filename: __filename});380 [alice] = await helper.arrange.createAccounts([10n], donor);382 [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);381 });383 });382 });384 });383385410 });412 });411413412 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {414 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {413 const alice = await privateKey('//Alice');415 const collectionMinter = alice;416 const owner = bob;417 const receiver = charlie;414 const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});418 const collection = await helper.nft.mintCollection(collectionMinter, {name: 'A', description: 'B', tokenPrefix: 'C'});415419416 const owner = await privateKey('//Bob');417 const spender = await helper.eth.createAccountWithBalance(alice, 100n);420 const spender = await helper.eth.createAccountWithBalance(donor, 100n);418 const receiver = await privateKey('//Charlie');419421420 const token = await collection.mintToken(alice, {Substrate: owner.address});422 const token = await collection.mintToken(collectionMinter, {Substrate: owner.address});421423422 const address = helper.ethAddress.fromCollectionId(collection.collectionId);424 const address = helper.ethAddress.fromCollectionId(collection.collectionId);423 const contract = helper.ethNativeContract.collection(address, 'nft');425 const contract = helper.ethNativeContract.collection(address, 'nft');tests/src/eth/reFungible.test.tsdiffbeforeafterboth104104105describe('Refungible: Plain calls', () => {105describe('Refungible: Plain calls', () => {106 let donor: IKeyringPair;106 let donor: IKeyringPair;107 let alice: IKeyringPair;108 let bob: IKeyringPair;109 let charlie: IKeyringPair;107110108 before(async function() {111 before(async function() {109 await usingEthPlaygrounds(async (helper, privateKey) => {112 await usingEthPlaygrounds(async (helper, privateKey) => {110 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);113 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);111114112 donor = await privateKey({filename: __filename});115 donor = await privateKey({filename: __filename});116 [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);113 });117 });114 });118 });115119228 });232 });229233230 itEth('Can perform burnFrom()', async ({helper, privateKey}) => {234 itEth('Can perform burnFrom()', async ({helper, privateKey}) => {231 const alice = await privateKey('//Alice');232 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});235 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});233236234 const owner = await helper.eth.createAccountWithBalance(alice, 100n);237 const owner = await helper.eth.createAccountWithBalance(donor, 100n);235 const spender = await helper.eth.createAccountWithBalance(alice, 100n);238 const spender = await helper.eth.createAccountWithBalance(donor, 100n);236239237 const token = await collection.mintToken(alice, 100n, {Ethereum: owner});240 const token = await collection.mintToken(alice, 100n, {Ethereum: owner});238241262 });265 });263266264 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {267 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {265 const alice = await privateKey('//Alice');266 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});268 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});267269 268 const owner = await privateKey('//Bob');270 const owner = bob;269 const spender = await helper.eth.createAccountWithBalance(alice, 100n);271 const spender = await helper.eth.createAccountWithBalance(donor, 100n);270272271 const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});273 const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});272274295 });297 });296298297 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {299 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {298 const alice = await privateKey('//Alice');299 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});300 const collection = await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});300301301 const owner = await privateKey('//Bob');302 const owner = bob;302 const spender = await helper.eth.createAccountWithBalance(alice, 100n);303 const spender = await helper.eth.createAccountWithBalance(donor, 100n);303 const receiver = await privateKey('//Charlie');304 const receiver = charlie;304305305 const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});306 const token = await collection.mintToken(alice, 100n, {Substrate: owner.address});306307tests/src/eth/scheduling.test.tsdiffbeforeafterboth26 });26 });27 });27 });282829 itEth.ifWithPallets('Successfully schedules and periodically executes an EVM contract', [Pallets.Scheduler], async ({helper, privateKey}) => {29 itEth.ifWithPallets.only('Successfully schedules and periodically executes an EVM contract', [Pallets.Scheduler], async ({helper, privateKey}) => {30 const alice = await privateKey('//Alice');30 const donor = await privateKey({filename: __filename});31 const [alice] = await helper.arrange.createAccounts([1000n], donor);313232 const scheduledId = await helper.arrange.makeScheduledId();33 const scheduledId = await helper.arrange.makeScheduledId();3334tests/src/inflation.seqtest.tsdiffbeforeafterbothno changes
tests/src/inflation.test.tsdiffbeforeafterbothno changes
tests/src/scheduler.seqtest.tsdiffbeforeafterbothno changes
tests/src/scheduler.test.tsdiffbeforeafterbothno changes