difftreelog
Fix admin test and remove //Alice
in: master
2 files changed
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth77 const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', 'uri');77 const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', 'uri');78 const adminEth = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();78 const adminEth = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();79 const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);79 const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);80 const [adminSub] = await helper.arrange.createAccounts([100n], donor);81 const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);80 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);82 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);81 83 82 // cannot mint while not admin84 // cannot mint while not admin83 await expect(collectionEvm.methods.mint(owner).send({from: adminEth})).to.be.rejectedWith('PublicMintingNotAllowed');85 await expect(collectionEvm.methods.mint(owner).send({from: adminEth})).to.be.rejected;84 86 await expect(helper.nft.mintToken(adminSub, {collectionId, owner: {Ethereum: owner}})).to.be.rejectedWith(/common.PublicMintingNotAllowed/);87 85 // admin can mint token:88 // admin (sub and eth) can mint token:86 await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();89 await collectionEvm.methods.addCollectionAdminCross(adminCrossEth).send();90 await collectionEvm.methods.addCollectionAdminCross(adminCrossSub).send();87 await collectionEvm.methods.mint(owner).send({from: adminEth});91 await collectionEvm.methods.mint(owner).send({from: adminEth});92 await helper.nft.mintToken(adminSub, {collectionId, owner: {Ethereum: owner}});889389 expect(await helper.collection.getLastTokenId(collectionId)).to.eq(1);94 expect(await helper.collection.getLastTokenId(collectionId)).to.eq(2);90 });95 });919692 itEth('cannot add invalid cross account admin', async ({helper}) => {97 itEth('cannot add invalid cross account admin', async ({helper}) => {tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -360,13 +360,11 @@
}
});
- itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
- const minter = await privateKey('//Alice');
+ itEth('Can perform transferFromCross()', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = await privateKey('//Bob');
+ const [owner, receiver] = await helper.arrange.createAccounts([100n, 100n], donor);
const spender = await helper.eth.createAccountWithBalance(donor);
- const receiver = await privateKey('//Charlie');
const token = await collection.mintToken(minter, {Substrate: owner.address});