difftreelog
Add changeCollectionOwnerCross checks
in: master
1 file changed
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth405405406 itEth('Change owner [cross]', async ({helper}) => {406 itEth('Change owner [cross]', async ({helper}) => {407 const owner = await helper.eth.createAccountWithBalance(donor);407 const owner = await helper.eth.createAccountWithBalance(donor);408 const ownerEth = await helper.eth.createAccountWithBalance(donor);409 const ownerCrossEth = helper.ethCrossAccount.fromAddress(ownerEth);408 const [newOwner] = await helper.arrange.createAccounts([10n], donor);410 const [ownerSub] = await helper.arrange.createAccounts([10n], donor);409 const newOwnerCross = helper.ethCrossAccount.fromKeyringPair(newOwner);411 const ownerCrossSub = helper.ethCrossAccount.fromKeyringPair(ownerSub);412410 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');413 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');411 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);414 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);412415413 expect(await collectionEvm.methods.isOwnerOrAdminCross(newOwnerCross).call()).to.be.false;416 expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossSub).call()).to.be.false;414417418 // Can set ethereum owner:415 await collectionEvm.methods.changeCollectionOwnerCross(newOwnerCross).send();419 await collectionEvm.methods.changeCollectionOwnerCross(ownerCrossEth).send({from: owner});416417 expect(await collectionEvm.methods.isOwnerOrAdminCross(newOwnerCross).call()).to.be.true;420 expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossEth).call()).to.be.true;421 expect(await helper.collection.getData(collectionId))422 .to.have.property('normalizedOwner').that.is.eq(helper.address.ethToSubstrate(ownerEth));423 424 // Can set Substrate owner:425 await collectionEvm.methods.changeCollectionOwnerCross(ownerCrossSub).send({from: ownerEth});426 expect(await collectionEvm.methods.isOwnerOrAdminCross(ownerCrossSub).call()).to.be.true;427 expect(await helper.collection.getData(collectionId))428 .to.have.property('normalizedOwner').that.is.eq(ownerSub.address);418 });429 });419430420 itEth.skip('change owner call fee', async ({helper}) => {431 itEth.skip('change owner call fee', async ({helper}) => {