git.delta.rocks / unique-network / refs/commits / e36664cd2284

difftreelog

Remove old test

Max Andreev2022-12-16parent: #a3aa9d1.patch.diff
in: master

1 file changed

modifiedtests/src/eth/allowlist.test.tsdiffbeforeafterboth
156 await expect(collectionEvm.methods.transfer(owner, 2).send({from: userEth})).to.be.rejectedWith(/Transaction has been reverted/);156 await expect(collectionEvm.methods.transfer(owner, 2).send({from: userEth})).to.be.rejectedWith(/Transaction has been reverted/);
157 }));157 }));
158
159 // Soft-deprecated
160 itEth('Collection allowlist cannot be added and removed [eth] address by not owner', async ({helper}) => {
161 const owner = await helper.eth.createAccountWithBalance(donor);
162 const notOwner = await helper.eth.createAccountWithBalance(donor);
163 const user = helper.eth.createAccount();
164 const crossUser = helper.ethCrossAccount.fromAddress(user);
165
166 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
167 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
168
169 expect(await collectionEvm.methods.allowlistedCross(crossUser).call({from: owner})).to.be.false;
170 await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');
171 expect(await collectionEvm.methods.allowlistedCross(crossUser).call({from: owner})).to.be.false;
172 await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});
173 expect(await collectionEvm.methods.allowlistedCross(crossUser).call({from: owner})).to.be.true;
174 await expect(collectionEvm.methods.removeFromCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission');
175 expect(await collectionEvm.methods.allowlistedCross(crossUser).call({from: owner})).to.be.true;
176 });
177158
178 [159 [
179 // cross-methods160 // cross-methods
185 {mode: 'rft' as const, cross: false, requiredPallets: [Pallets.ReFungible]},166 {mode: 'rft' as const, cross: false, requiredPallets: [Pallets.ReFungible]},
186 {mode: 'ft' as const, cross: false, requiredPallets: []},167 {mode: 'ft' as const, cross: false, requiredPallets: []},
187 ].map(testCase => 168 ].map(testCase =>
188 itEth.only(`Collection allowlist can not be add and remove [cross] address by non-owner for ${testCase.mode}`, async ({helper}) => {169 itEth.only(`Non-owner cannot add or remove from collection allowlist ${testCase.cross ? 'cross ' : ''}${testCase.mode}`, async ({helper}) => {
189 // Select methods:170 // Select methods:
190 const addToAllowList = testCase.cross ? 'addToCollectionAllowListCross' : 'addToCollectionAllowList';171 const addToAllowList = testCase.cross ? 'addToCollectionAllowListCross' : 'addToCollectionAllowList';
191 const removeFromAllowList = testCase.cross ? 'removeFromCollectionAllowListCross' : 'removeFromCollectionAllowList';172 const removeFromAllowList = testCase.cross ? 'removeFromCollectionAllowListCross' : 'removeFromCollectionAllowList';