difftreelog
Fix tests for quartz and unique runtimes and skip scheduling
in: master
2 files changed
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth93 expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');93 expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');94 });94 });959596 itEth('Sponsoring collection from evm address via access list', async ({helper, privateKey}) => {96 itEth('Sponsoring collection from evm address via access list', async ({helper}) => {97 const owner = await helper.eth.createAccountWithBalance(donor);97 const owner = await helper.eth.createAccountWithBalance(donor);98 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);98 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);9999106106107 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});107 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});108 let collectionData = (await collection.getData())!;108 let collectionData = (await collection.getData())!;109 const ss58Format = helper.chain.getChainProperties().ss58Format;110 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor));109 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));111 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');110 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');112111113 await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});112 await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});114 collectionData = (await collection.getData())!;113 collectionData = (await collection.getData())!;115 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor));114 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));116115117 const user = helper.eth.createAccount();116 const user = helper.eth.createAccount();118 const nextTokenId = await collectionEvm.methods.nextTokenId().call();117 const nextTokenId = await collectionEvm.methods.nextTokenId().call();220 // }219 // }221 // });220 // });222221223 itEth('Check that transaction via EVM spend money from sponsor address', async ({helper, privateKey}) => {222 itEth('Check that transaction via EVM spend money from sponsor address', async ({helper}) => {224 const owner = await helper.eth.createAccountWithBalance(donor);223 const owner = await helper.eth.createAccountWithBalance(donor);225 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);224 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);226225233232234 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();233 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();235 let collectionData = (await collection.getData())!;234 let collectionData = (await collection.getData())!;236 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor));235 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));237 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');236 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');238237239 const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor);238 const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor);240 await sponsorCollection.methods.confirmCollectionSponsorship().send();239 await sponsorCollection.methods.confirmCollectionSponsorship().send();241 collectionData = (await collection.getData())!;240 collectionData = (await collection.getData())!;242 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor));241 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));243242244 const user = helper.eth.createAccount();243 const user = helper.eth.createAccount();245 await collectionEvm.methods.addCollectionAdmin(user).send();244 await collectionEvm.methods.addCollectionAdmin(user).send();272 ]);271 ]);273 expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');272 expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');274 273 275 const ownerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner));274 const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));276 expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);275 expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);277 const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));276 const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));278 expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;277 expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;279 });278 });280});279});tests/src/eth/scheduling.test.tsdiffbeforeafterboth18import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';18import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';19import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers';19import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers';202021// TODO mrshiposha update this test in #58121describe('Scheduing EVM smart contracts', () => {22describe.skip('Scheduing EVM smart contracts', () => {22 before(async function() {23 before(async function() {23 await requirePallets(this, [Pallets.Scheduler]);24 await requirePallets(this, [Pallets.Scheduler]);24 });25 });