difftreelog
Fix allowlistCross tests
in: master
1 file changed
tests/src/eth/allowlist.test.tsdiffbeforeafterboth106 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;106 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;107 await collectionEvm.methods.addToCollectionAllowListCross(userCrossSub).send({from: owner});107 await collectionEvm.methods.addToCollectionAllowListCross(userCrossSub).send({from: owner});108 await collectionEvm.methods.addToCollectionAllowListCross(userCrossEth).send({from: owner});108 await collectionEvm.methods.addToCollectionAllowListCross(userCrossEth).send({from: owner});109 await collectionEvm.methods.addToCollectionAllowListCross(ownerCrossEth).send({from: owner});109 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.true;110 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.true;110 expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.true;111 expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.true;111 expect(await collectionEvm.methods.allowlistedCross(userCrossSub).call({from: owner})).to.be.true;112 expect(await collectionEvm.methods.allowlistedCross(userCrossSub).call({from: owner})).to.be.true;112 expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.true;113 expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.true;113114114 // allowlisted account can transfer tokens:115 await collectionEvm.methods.mint(userEth).send();115 await collectionEvm.methods.mint(userEth).send(); // token #1116 await collectionEvm.methods.mint(userEth).send(); // token #2116 await collectionEvm.methods.setCollectionAccess(1).send();117 await collectionEvm.methods.setCollectionAccess(1).send();118 119 // allowlisted account can transfer and transferCross:117 await collectionEvm.methods.transfer(owner, 1).send({from: userEth}); // FIXME: why not?120 await collectionEvm.methods.transfer(owner, 1).send({from: userEth});118 // await collectionEvm.methods.transferCross(ownerCrossEth, 1).send({from: userEth}); // FIXME: why not?121 await collectionEvm.methods.transferCross(userCrossSub, 2).send({from: userEth});119 expect(await helper.nft.getTokenOwner(collectionId, 1)).to.eq({Ethereum: owner});122 expect(await helper.nft.getTokenOwner(collectionId, 1)).to.deep.eq({Ethereum: owner});120 123 expect(await helper.nft.getTokenOwner(collectionId, 2)).to.deep.eq({Substrate: userSub.address});124 121 // can removeFromCollectionAllowListCross125 // can removeFromCollectionAllowListCross:122 await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossSub).send({from: owner});126 await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossSub).send({from: owner});123 await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossEth).send({from: owner});127 await collectionEvm.methods.removeFromCollectionAllowListCross(userCrossEth).send({from: owner});124 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;128 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;125 expect(await helper.collection.allowed(collectionId, {Substrate: userEth})).to.be.false;129 expect(await helper.collection.allowed(collectionId, {Ethereum: userEth})).to.be.false;130 expect(await collectionEvm.methods.allowlistedCross(userCrossSub).call({from: owner})).to.be.false;126 expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.false;131 expect(await collectionEvm.methods.allowlistedCross(userCrossEth).call({from: owner})).to.be.false;127132128 // cannot transfer anymore133 // cannot transfer anymore129 await collectionEvm.methods.mint(userEth).send();134 await collectionEvm.methods.mint(userEth).send();130 await expect(collectionEvm.methods.transfer(owner, 2).send({from: userEth})).to.be.rejected;135 await expect(collectionEvm.methods.transfer(owner, 2).send({from: userEth})).to.be.rejectedWith(/Transaction has been reverted/);131 });136 });132137133 // Soft-deprecated138 // Soft-deprecated