difftreelog
fix await require pallets
in: master
9 files changed
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -36,7 +36,7 @@
describe('App promotion', () => {
before(async function () {
await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]);
+ await requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]);
alice = privateKey('//Alice');
palletAdmin = privateKey('//Charlie'); // TODO use custom address
const api = helper.getApi();
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.8//9// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {evmToAddress} from '@polkadot/util-crypto';18import {IKeyringPair} from '@polkadot/types/types';19import {Pallets, requirePalletsOrSkip} from '../util/playgrounds';20import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds';212223describe('Create RFT collection from EVM', () => {24 let donor: IKeyringPair;2526 before(async function() {27 await usingEthPlaygrounds(async (helper, privateKey) => {28 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);29 donor = privateKey('//Alice');30 });31 });3233 itEth('Create collection', async ({helper}) => {34 const owner = await helper.eth.createAccountWithBalance(donor);35 36 const name = 'CollectionEVM';37 const description = 'Some description';38 const prefix = 'token prefix';39 40 // todo:playgrounds this might fail when in async environment.41 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;42 const {collectionId} = await helper.eth.createRefungibleCollection(owner, name, description, prefix);43 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;44 45 const data = (await helper.rft.getData(collectionId))!;4647 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);48 expect(collectionId).to.be.eq(collectionCountAfter);49 expect(data.name).to.be.eq(name);50 expect(data.description).to.be.eq(description);51 expect(data.raw.tokenPrefix).to.be.eq(prefix);52 expect(data.raw.mode).to.be.eq('ReFungible');53 });5455 // todo:playgrounds this test will fail when in async environment.56 itEth('Check collection address exist', async ({helper}) => {57 const owner = await helper.eth.createAccountWithBalance(donor);5859 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;60 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);61 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);6263 expect(await collectionHelpers.methods64 .isCollectionExist(expectedCollectionAddress)65 .call()).to.be.false;6667 await collectionHelpers.methods68 .createRFTCollection('A', 'A', 'A')69 .send({value: Number(2n * helper.balance.getOneTokenNominal())});70 71 expect(await collectionHelpers.methods72 .isCollectionExist(expectedCollectionAddress)73 .call()).to.be.true;74 });75 76 itEth('Set sponsorship', async ({helper}) => {77 const owner = await helper.eth.createAccountWithBalance(donor);78 const sponsor = await helper.eth.createAccountWithBalance(donor);79 const ss58Format = helper.chain.getChainProperties().ss58Format;80 const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY');8182 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);83 await collection.methods.setCollectionSponsor(sponsor).send();8485 let data = (await helper.rft.getData(collectionId))!;86 expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));8788 await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');8990 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);91 await sponsorCollection.methods.confirmCollectionSponsorship().send();9293 data = (await helper.rft.getData(collectionId))!;94 expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));95 });9697 itEth('Set limits', async ({helper}) => {98 const owner = await helper.eth.createAccountWithBalance(donor);99 const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'INSI');100 const limits = {101 accountTokenOwnershipLimit: 1000,102 sponsoredDataSize: 1024,103 sponsoredDataRateLimit: 30,104 tokenLimit: 1000000,105 sponsorTransferTimeout: 6,106 sponsorApproveTimeout: 6,107 ownerCanTransfer: false,108 ownerCanDestroy: false,109 transfersEnabled: false,110 };111112 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);113 await collection.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send();114 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send();115 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send();116 await collection.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send();117 await collection.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send();118 await collection.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send();119 await collection.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send();120 await collection.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send();121 await collection.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send();122 123 const data = (await helper.rft.getData(collectionId))!;124 expect(data.raw.limits.accountTokenOwnershipLimit).to.be.eq(limits.accountTokenOwnershipLimit);125 expect(data.raw.limits.sponsoredDataSize).to.be.eq(limits.sponsoredDataSize);126 expect(data.raw.limits.sponsoredDataRateLimit.blocks).to.be.eq(limits.sponsoredDataRateLimit);127 expect(data.raw.limits.tokenLimit).to.be.eq(limits.tokenLimit);128 expect(data.raw.limits.sponsorTransferTimeout).to.be.eq(limits.sponsorTransferTimeout);129 expect(data.raw.limits.sponsorApproveTimeout).to.be.eq(limits.sponsorApproveTimeout);130 expect(data.raw.limits.ownerCanTransfer).to.be.eq(limits.ownerCanTransfer);131 expect(data.raw.limits.ownerCanDestroy).to.be.eq(limits.ownerCanDestroy);132 expect(data.raw.limits.transfersEnabled).to.be.eq(limits.transfersEnabled);133 });134135 itEth('Collection address exist', async ({helper}) => {136 const owner = await helper.eth.createAccountWithBalance(donor);137 const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';138 expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)139 .methods.isCollectionExist(collectionAddressForNonexistentCollection).call())140 .to.be.false;141 142 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Exister', 'absolutely anything', 'WIWT');143 expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)144 .methods.isCollectionExist(collectionAddress).call())145 .to.be.true;146 });147});148149describe('(!negative tests!) Create RFT collection from EVM', () => {150 let donor: IKeyringPair;151 let nominal: bigint;152153 before(async function() {154 await usingEthPlaygrounds(async (helper, privateKey) => {155 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);156 donor = privateKey('//Alice');157 nominal = helper.balance.getOneTokenNominal();158 });159 });160161 itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {162 const owner = await helper.eth.createAccountWithBalance(donor);163 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);164 {165 const MAX_NAME_LENGTH = 64;166 const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);167 const description = 'A';168 const tokenPrefix = 'A';169170 await expect(collectionHelper.methods171 .createRFTCollection(collectionName, description, tokenPrefix)172 .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH);173 }174 {175 const MAX_DESCRIPTION_LENGTH = 256;176 const collectionName = 'A';177 const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1);178 const tokenPrefix = 'A';179 await expect(collectionHelper.methods180 .createRFTCollection(collectionName, description, tokenPrefix)181 .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH);182 }183 {184 const MAX_TOKEN_PREFIX_LENGTH = 16;185 const collectionName = 'A';186 const description = 'A';187 const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1);188 await expect(collectionHelper.methods189 .createRFTCollection(collectionName, description, tokenPrefix)190 .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);191 }192 });193 194 itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {195 const owner = await helper.eth.createAccountWithBalance(donor);196 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);197 await expect(collectionHelper.methods198 .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW')199 .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');200 });201202 itEth('(!negative test!) Check owner', async ({helper}) => {203 const owner = await helper.eth.createAccountWithBalance(donor);204 const peasant = helper.eth.createAccount();205 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE');206 const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant);207 const EXPECTED_ERROR = 'NoPermission';208 {209 const sponsor = await helper.eth.createAccountWithBalance(donor);210 await expect(peasantCollection.methods211 .setCollectionSponsor(sponsor)212 .call()).to.be.rejectedWith(EXPECTED_ERROR);213 214 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);215 await expect(sponsorCollection.methods216 .confirmCollectionSponsorship()217 .call()).to.be.rejectedWith('caller is not set as sponsor');218 }219 {220 await expect(peasantCollection.methods221 .setCollectionLimit('account_token_ownership_limit', '1000')222 .call()).to.be.rejectedWith(EXPECTED_ERROR);223 }224 });225226 itEth('(!negative test!) Set limits', async ({helper}) => {227 const owner = await helper.eth.createAccountWithBalance(donor);228 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'ISNI');229 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);230 await expect(collectionEvm.methods231 .setCollectionLimit('badLimit', 'true')232 .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');233 });234});1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.8//9// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {evmToAddress} from '@polkadot/util-crypto';18import {IKeyringPair} from '@polkadot/types/types';19import {Pallets, requirePalletsOrSkip} from '../util/playgrounds';20import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds';212223describe('Create RFT collection from EVM', () => {24 let donor: IKeyringPair;2526 before(async function() {27 await usingEthPlaygrounds(async (helper, privateKey) => {28 await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);29 donor = privateKey('//Alice');30 });31 });3233 itEth('Create collection', async ({helper}) => {34 const owner = await helper.eth.createAccountWithBalance(donor);35 36 const name = 'CollectionEVM';37 const description = 'Some description';38 const prefix = 'token prefix';39 40 // todo:playgrounds this might fail when in async environment.41 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;42 const {collectionId} = await helper.eth.createRefungibleCollection(owner, name, description, prefix);43 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;44 45 const data = (await helper.rft.getData(collectionId))!;4647 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);48 expect(collectionId).to.be.eq(collectionCountAfter);49 expect(data.name).to.be.eq(name);50 expect(data.description).to.be.eq(description);51 expect(data.raw.tokenPrefix).to.be.eq(prefix);52 expect(data.raw.mode).to.be.eq('ReFungible');53 });5455 // todo:playgrounds this test will fail when in async environment.56 itEth('Check collection address exist', async ({helper}) => {57 const owner = await helper.eth.createAccountWithBalance(donor);5859 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;60 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);61 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);6263 expect(await collectionHelpers.methods64 .isCollectionExist(expectedCollectionAddress)65 .call()).to.be.false;6667 await collectionHelpers.methods68 .createRFTCollection('A', 'A', 'A')69 .send({value: Number(2n * helper.balance.getOneTokenNominal())});70 71 expect(await collectionHelpers.methods72 .isCollectionExist(expectedCollectionAddress)73 .call()).to.be.true;74 });75 76 itEth('Set sponsorship', async ({helper}) => {77 const owner = await helper.eth.createAccountWithBalance(donor);78 const sponsor = await helper.eth.createAccountWithBalance(donor);79 const ss58Format = helper.chain.getChainProperties().ss58Format;80 const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY');8182 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);83 await collection.methods.setCollectionSponsor(sponsor).send();8485 let data = (await helper.rft.getData(collectionId))!;86 expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));8788 await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');8990 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);91 await sponsorCollection.methods.confirmCollectionSponsorship().send();9293 data = (await helper.rft.getData(collectionId))!;94 expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));95 });9697 itEth('Set limits', async ({helper}) => {98 const owner = await helper.eth.createAccountWithBalance(donor);99 const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'INSI');100 const limits = {101 accountTokenOwnershipLimit: 1000,102 sponsoredDataSize: 1024,103 sponsoredDataRateLimit: 30,104 tokenLimit: 1000000,105 sponsorTransferTimeout: 6,106 sponsorApproveTimeout: 6,107 ownerCanTransfer: false,108 ownerCanDestroy: false,109 transfersEnabled: false,110 };111112 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);113 await collection.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send();114 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send();115 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send();116 await collection.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send();117 await collection.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send();118 await collection.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send();119 await collection.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send();120 await collection.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send();121 await collection.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send();122 123 const data = (await helper.rft.getData(collectionId))!;124 expect(data.raw.limits.accountTokenOwnershipLimit).to.be.eq(limits.accountTokenOwnershipLimit);125 expect(data.raw.limits.sponsoredDataSize).to.be.eq(limits.sponsoredDataSize);126 expect(data.raw.limits.sponsoredDataRateLimit.blocks).to.be.eq(limits.sponsoredDataRateLimit);127 expect(data.raw.limits.tokenLimit).to.be.eq(limits.tokenLimit);128 expect(data.raw.limits.sponsorTransferTimeout).to.be.eq(limits.sponsorTransferTimeout);129 expect(data.raw.limits.sponsorApproveTimeout).to.be.eq(limits.sponsorApproveTimeout);130 expect(data.raw.limits.ownerCanTransfer).to.be.eq(limits.ownerCanTransfer);131 expect(data.raw.limits.ownerCanDestroy).to.be.eq(limits.ownerCanDestroy);132 expect(data.raw.limits.transfersEnabled).to.be.eq(limits.transfersEnabled);133 });134135 itEth('Collection address exist', async ({helper}) => {136 const owner = await helper.eth.createAccountWithBalance(donor);137 const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';138 expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)139 .methods.isCollectionExist(collectionAddressForNonexistentCollection).call())140 .to.be.false;141 142 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Exister', 'absolutely anything', 'WIWT');143 expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)144 .methods.isCollectionExist(collectionAddress).call())145 .to.be.true;146 });147});148149describe('(!negative tests!) Create RFT collection from EVM', () => {150 let donor: IKeyringPair;151 let nominal: bigint;152153 before(async function() {154 await usingEthPlaygrounds(async (helper, privateKey) => {155 await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);156 donor = privateKey('//Alice');157 nominal = helper.balance.getOneTokenNominal();158 });159 });160161 itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {162 const owner = await helper.eth.createAccountWithBalance(donor);163 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);164 {165 const MAX_NAME_LENGTH = 64;166 const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);167 const description = 'A';168 const tokenPrefix = 'A';169170 await expect(collectionHelper.methods171 .createRFTCollection(collectionName, description, tokenPrefix)172 .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH);173 }174 {175 const MAX_DESCRIPTION_LENGTH = 256;176 const collectionName = 'A';177 const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1);178 const tokenPrefix = 'A';179 await expect(collectionHelper.methods180 .createRFTCollection(collectionName, description, tokenPrefix)181 .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH);182 }183 {184 const MAX_TOKEN_PREFIX_LENGTH = 16;185 const collectionName = 'A';186 const description = 'A';187 const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1);188 await expect(collectionHelper.methods189 .createRFTCollection(collectionName, description, tokenPrefix)190 .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);191 }192 });193 194 itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {195 const owner = await helper.eth.createAccountWithBalance(donor);196 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);197 await expect(collectionHelper.methods198 .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW')199 .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');200 });201202 itEth('(!negative test!) Check owner', async ({helper}) => {203 const owner = await helper.eth.createAccountWithBalance(donor);204 const peasant = helper.eth.createAccount();205 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE');206 const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant);207 const EXPECTED_ERROR = 'NoPermission';208 {209 const sponsor = await helper.eth.createAccountWithBalance(donor);210 await expect(peasantCollection.methods211 .setCollectionSponsor(sponsor)212 .call()).to.be.rejectedWith(EXPECTED_ERROR);213 214 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);215 await expect(sponsorCollection.methods216 .confirmCollectionSponsorship()217 .call()).to.be.rejectedWith('caller is not set as sponsor');218 }219 {220 await expect(peasantCollection.methods221 .setCollectionLimit('account_token_ownership_limit', '1000')222 .call()).to.be.rejectedWith(EXPECTED_ERROR);223 }224 });225226 itEth('(!negative test!) Set limits', async ({helper}) => {227 const owner = await helper.eth.createAccountWithBalance(donor);228 const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'ISNI');229 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);230 await expect(collectionEvm.methods231 .setCollectionLimit('badLimit', 'true')232 .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');233 });234});tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -84,7 +84,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
});
@@ -224,7 +224,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
});
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -23,7 +23,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
@@ -115,7 +115,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
@@ -327,7 +327,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
@@ -368,7 +368,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([20n], donor);
tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -26,7 +26,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([20n], donor);
@@ -70,7 +70,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
@@ -134,7 +134,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([50n], donor);
@@ -325,7 +325,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([50n], donor);
@@ -380,7 +380,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([50n], donor);
@@ -470,7 +470,7 @@
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = privateKey('//Alice');
});
tests/src/eth/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/index.ts
+++ b/tests/src/eth/util/playgrounds/index.ts
@@ -48,7 +48,7 @@
opts.skip ? it.skip : it)(name, async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
if (opts.requiredPallets) {
- requirePalletsOrSkip(this, helper, opts.requiredPallets);
+ await requirePalletsOrSkip(this, helper, opts.requiredPallets);
}
await cb({helper, privateKey});
tests/src/limits.test.tsdiffbeforeafterboth--- a/tests/src/limits.test.ts
+++ b/tests/src/limits.test.ts
@@ -58,7 +58,7 @@
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
const donor = privateKey('//Alice');
[alice] = await helper.arrange.createAccounts([10n], donor);
@@ -364,7 +364,7 @@
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
const donor = privateKey('//Alice');
[alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
tests/src/nesting/properties.test.tsdiffbeforeafterboth--- a/tests/src/nesting/properties.test.ts
+++ b/tests/src/nesting/properties.test.ts
@@ -975,7 +975,7 @@
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
const donor = privateKey('//Alice');
[alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
tests/src/refungible.test.tsdiffbeforeafterboth--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -25,7 +25,7 @@
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
- requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
const donor = privateKey('//Alice');
[alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor);