git.delta.rocks / unique-network / refs/commits / 48cdcf7aa35b

difftreelog

fix minor fixes in eth tests

Daniel Shiposha2022-10-03parent: #22fb1ca.patch.diff
in: master

2 files changed

modifiedtests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
65 let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();65 let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();
66 const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);66 const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
67 const sponsor = await helper.eth.createAccountWithBalance(alice);67 const sponsor = await helper.eth.createAccountWithBalance(alice);
68 const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);68 const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);
6969
70 expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;70 expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
71 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});71 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});
220 const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress);220 const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress);
221 const collection = helper.nft.getCollectionObject(collectionId);221 const collection = helper.nft.getCollectionObject(collectionId);
222 const sponsor = await helper.eth.createAccountWithBalance(alice);222 const sponsor = await helper.eth.createAccountWithBalance(alice);
223 const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);223 const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);
224224
225 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();225 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();
226 let collectionData = (await collection.getData())!;226 let collectionData = (await collection.getData())!;
227 const ss58Format = helper.chain.getChainProperties().ss58Format;227 const ss58Format = helper.chain.getChainProperties().ss58Format;
228 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));228 expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));
229 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');229 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');
230230
231 const sponsorCollection = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor);231 const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor);
232 await sponsorCollection.methods.confirmCollectionSponsorship().send();232 await sponsorCollection.methods.confirmCollectionSponsorship().send();
233 collectionData = (await collection.getData())!;233 collectionData = (await collection.getData())!;
234 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));234 expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));
239 const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner));239 const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner));
240 const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));240 const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
241241
242 const userCollectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', user);242 const userCollectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', user);
243 const nextTokenId = await userCollectionEvm.methods.nextTokenId().call();243 const nextTokenId = await userCollectionEvm.methods.nextTokenId().call();
244 expect(nextTokenId).to.be.equal('1');244 expect(nextTokenId).to.be.equal('1');
245 result = await userCollectionEvm.methods.mintWithTokenURI(245 result = await userCollectionEvm.methods.mintWithTokenURI(
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
1import {cartesian} from './util/helpers';1import {cartesian} from './util/helpers';
2import {itEth, expect} from '../eth/util/playgrounds';2import {itEth, expect} from '../eth/util/playgrounds';
33
4describe.only('EVM token properties', () => {4describe('EVM token properties', () => {
5 itEth('Can be reconfigured', async({helper, privateKey}) => {5 itEth('Can be reconfigured', async({helper, privateKey}) => {
6 const alice = privateKey('//Alice');6 const alice = privateKey('//Alice');
7 const caller = await helper.eth.createAccountWithBalance(alice);7 const caller = await helper.eth.createAccountWithBalance(alice);