difftreelog
test remove .only
in: master
14 files changed
tests/src/benchmarks/utils/common.tsdiffbeforeafterboth--- a/tests/src/benchmarks/utils/common.ts
+++ b/tests/src/benchmarks/utils/common.ts
@@ -91,4 +91,4 @@
await collection.setTokenPropertyPermissions(donor, permissions);
return collection;
-}
\ No newline at end of file
+}
tests/src/creditFeesToTreasury.seqtest.tsdiffbeforeafterboth--- a/tests/src/creditFeesToTreasury.seqtest.ts
+++ b/tests/src/creditFeesToTreasury.seqtest.ts
@@ -88,7 +88,7 @@
expect(treasuryIncrease).to.be.equal(fee);
});
- itSub.only('Treasury balance increased by failed tx fee', async ({helper}) => {
+ itSub('Treasury balance increased by failed tx fee', async ({helper}) => {
const api = helper.getApi();
await helper.wait.newBlocks(1);
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -18,7 +18,7 @@
import {Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../util/index';
import {itEth, expect} from './util';
-describe.only('evm nft collection sponsoring', () => {
+describe('evm nft collection sponsoring', () => {
let donor: IKeyringPair;
let alice: IKeyringPair;
let nominal: bigint;
@@ -319,7 +319,7 @@
});
});
-describe.only('evm RFT collection sponsoring', () => {
+describe('evm RFT collection sponsoring', () => {
let donor: IKeyringPair;
let alice: IKeyringPair;
let nominal: bigint;
tests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterboth--- a/tests/src/eth/createFTCollection.seqtest.ts
+++ b/tests/src/eth/createFTCollection.seqtest.ts
@@ -20,7 +20,7 @@
const DECIMALS = 18;
-describe.only('Create FT collection from EVM', () => {
+describe('Create FT collection from EVM', () => {
let donor: IKeyringPair;
before(async function() {
tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createFTCollection.test.ts
+++ b/tests/src/eth/createFTCollection.test.ts
@@ -22,7 +22,7 @@
const DECIMALS = 18;
-describe.only('Create FT collection from EVM', () => {
+describe('Create FT collection from EVM', () => {
let donor: IKeyringPair;
before(async function() {
@@ -129,7 +129,7 @@
});
});
-describe.only('(!negative tests!) Create FT collection from EVM', () => {
+describe('(!negative tests!) Create FT collection from EVM', () => {
let donor: IKeyringPair;
let nominal: bigint;
tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -21,7 +21,7 @@
import {COLLECTION_HELPER} from '../util';
-describe.only('Create NFT collection from EVM', () => {
+describe('Create NFT collection from EVM', () => {
let donor: IKeyringPair;
before(async function () {
@@ -143,7 +143,7 @@
});
});
-describe.only('(!negative tests!) Create NFT collection from EVM', () => {
+describe('(!negative tests!) Create NFT collection from EVM', () => {
let donor: IKeyringPair;
let nominal: bigint;
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -21,7 +21,7 @@
import {CollectionLimitField} from './util/playgrounds/types';
-describe.only('Create RFT collection from EVM', () => {
+describe('Create RFT collection from EVM', () => {
let donor: IKeyringPair;
before(async function() {
@@ -154,7 +154,7 @@
});
});
-describe.only('(!negative tests!) Create RFT collection from EVM', () => {
+describe('(!negative tests!) Create RFT collection from EVM', () => {
let donor: IKeyringPair;
let nominal: bigint;
tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -80,7 +80,7 @@
};
-describe.only('Fractionalizer contract usage', () => {
+describe('Fractionalizer contract usage', () => {
let donor: IKeyringPair;
before(async function() {
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -929,7 +929,7 @@
});
});
- itEth.only('Returns collection name', async ({helper}) => {
+ itEth('Returns collection name', async ({helper}) => {
// FIXME: should not have balance to use .call()
const caller = await helper.eth.createAccountWithBalance(donor);
const tokenPropertyPermissions = [{
tests/src/eth/payable.test.tsdiffbeforeafterboth--- a/tests/src/eth/payable.test.ts
+++ b/tests/src/eth/payable.test.ts
@@ -41,7 +41,7 @@
expect(await contract.methods.getCollected().call()).to.be.equal('10000');
});
- itEth.only('Evm contract can receive wei from substrate account', async ({helper}) => {
+ itEth('Evm contract can receive wei from substrate account', async ({helper}) => {
const deployer = await helper.eth.createAccountWithBalance(donor);
const contract = await helper.eth.deployCollectorContract(deployer);
const [alice] = await helper.arrange.createAccounts([40n], donor);
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -679,7 +679,7 @@
});
});
- itEth.only('Returns collection name', async ({helper}) => {
+ itEth('Returns collection name', async ({helper}) => {
// FIXME: should not have balance to use .call()
const caller = await helper.eth.createAccountWithBalance(alice);
const tokenPropertyPermissions = [{
tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -314,7 +314,7 @@
expect(result.length).to.equal(0);
}));
- itEth.only('Can be read', async({helper}) => {
+ itEth('Can be read', async({helper}) => {
// FIXME: User with no balance should be able to call
const caller = await helper.eth.createAccountWithBalance(alice);
const collection = await helper.nft.mintCollection(alice, {
tests/src/maintenance.seqtest.tsdiffbeforeafterboth--- a/tests/src/maintenance.seqtest.ts
+++ b/tests/src/maintenance.seqtest.ts
@@ -325,7 +325,7 @@
expect(await helper.preimage.getPreimageInfo(preimageHashes[0])).to.have.property('unrequested');
});
- itSub.only('Does not allow execution of a preimage that would fail', async ({helper}) => {
+ itSub('Does not allow execution of a preimage that would fail', async ({helper}) => {
const [zeroAccount] = await helper.arrange.createAccounts([0n], superuser);
const preimage = helper.constructApiCall('api.tx.balances.forceTransfer', [
tests/src/vesting.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.89// 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 {IKeyringPair} from '@polkadot/types/types';18import {itSub, usingPlaygrounds, expect} from './util';1920describe('Vesting', () => {21 let donor: IKeyringPair;22 let nominal: bigint;2324 before(async () => {25 await usingPlaygrounds(async (helper, privateKey) => {26 donor = await privateKey({url: import.meta.url});27 nominal = helper.balance.getOneTokenNominal();28 });29 });3031 itSub('can perform vestedTransfer and claim tokens', async ({helper}) => {32 // arrange33 const [sender, recepient] = await helper.arrange.createAccounts([1000n, 1n], donor);34 const currentRelayBlock = await helper.chain.getRelayBlockNumber();35 const SCHEDULE_1_PERIOD = 6n; // 6 blocks one period36 const SCHEDULE_1_START = currentRelayBlock + 6n; // Block when 1 schedule starts37 const SCHEDULE_2_PERIOD = 12n; // 12 blocks one period38 const SCHEDULE_2_START = currentRelayBlock + 12n; // Block when 2 schedule starts39 const schedule1 = {start: SCHEDULE_1_START, period: SCHEDULE_1_PERIOD, periodCount: 2n, perPeriod: 50n * nominal};40 const schedule2 = {start: SCHEDULE_2_START, period: SCHEDULE_2_PERIOD, periodCount: 2n, perPeriod: 100n * nominal};4142 // act43 await helper.balance.vestedTransfer(sender, recepient.address, schedule1);44 await helper.balance.vestedTransfer(sender, recepient.address, schedule2);45 let schedule = await helper.balance.getVestingSchedules(recepient.address);4647 // check senders balance after vesting:48 let balanceSender = await helper.balance.getSubstrateFull(sender.address);49 expect(balanceSender.free / nominal).to.eq(699n);50 expect(balanceSender.frozen).to.eq(0n);51 expect(balanceSender.reserved).to.eq(0n);5253 // check recepient balance after vesting:54 let balanceRecepient = await helper.balance.getSubstrateFull(recepient.address);55 expect(balanceRecepient.free).to.eq(301n * nominal);56 expect(balanceRecepient.frozen).to.eq(300n * nominal);57 expect(balanceRecepient.reserved).to.eq(0n);5859 // Schedules list correct:60 expect(schedule).to.has.length(2);61 expect(schedule[0]).to.deep.eq(schedule1);62 expect(schedule[1]).to.deep.eq(schedule2);6364 // Wait first part available:65 await helper.wait.forRelayBlockNumber(SCHEDULE_1_START + SCHEDULE_1_PERIOD);66 await helper.balance.claim(recepient);6768 // check recepient balance after claim (50 tokens claimed, 250 left):69 balanceRecepient = await helper.balance.getSubstrateFull(recepient.address);70 expect(balanceRecepient.free / nominal).to.eq(300n);71 expect(balanceRecepient.frozen).to.eq(250n * nominal);72 expect(balanceRecepient.reserved).to.eq(0n);7374 // Wait first schedule ends and first part od second schedule:75 await helper.wait.forRelayBlockNumber(SCHEDULE_2_START + SCHEDULE_2_PERIOD);76 await helper.balance.claim(recepient);7778 // check recepient balance after second claim (150 tokens claimed, 100 left):79 balanceRecepient = await helper.balance.getSubstrateFull(recepient.address);80 expect(balanceRecepient.free / nominal).to.eq(300n);81 expect(balanceRecepient.frozen).to.eq(100n * nominal);82 expect(balanceRecepient.reserved).to.eq(0n);8384 // Schedules list contain 1 vesting:85 schedule = await helper.balance.getVestingSchedules(recepient.address);86 expect(schedule).to.has.length(1);87 expect(schedule[0]).to.deep.eq(schedule2);8889 // Wait 2 schedule ends:90 await helper.wait.forRelayBlockNumber(SCHEDULE_2_START + SCHEDULE_2_PERIOD * 2n);91 await helper.balance.claim(recepient);9293 // check recepient balance after second claim (100 tokens claimed, 0 left):94 balanceRecepient = await helper.balance.getSubstrateFull(recepient.address);95 expect(balanceRecepient.free / nominal).to.eq(300n);96 expect(balanceRecepient.frozen).to.eq(0n);97 expect(balanceRecepient.reserved).to.eq(0n);9899 // check sender balance does not changed:100 balanceSender = await helper.balance.getSubstrateFull(sender.address);101 expect(balanceSender.free / nominal).to.eq(699n);102 expect(balanceSender.frozen).to.eq(0n);103 expect(balanceSender.reserved).to.eq(0n);104 });105106 itSub.only('cannot send more tokens than have', async ({helper}) => {107 const [sender, receiver] = await helper.arrange.createAccounts([1000n, 1n], donor);108 const schedule = {start: 0n, period: 1n, periodCount: 1n, perPeriod: 100n * nominal};109 const manyPeriodsSchedule = {start: 0n, period: 1n, periodCount: 100n, perPeriod: 10n * nominal};110 const oneBigSumSchedule = {start: 0n, period: 1n, periodCount: 1n, perPeriod: 5000n * nominal};111112 // Sender cannot send vestedTransfer to self or other113 await expect(helper.balance.vestedTransfer(sender, sender.address, manyPeriodsSchedule)).to.be.rejectedWith(/^vesting.InsufficientBalanceToLock$/);114 await expect(helper.balance.vestedTransfer(sender, receiver.address, manyPeriodsSchedule)).to.be.rejectedWith(/^Token: FundsUnavailable$/);115 await expect(helper.balance.vestedTransfer(sender, sender.address, oneBigSumSchedule)).to.be.rejectedWith(/^vesting.InsufficientBalanceToLock$/);116 await expect(helper.balance.vestedTransfer(sender, receiver.address, oneBigSumSchedule)).to.be.rejectedWith(/^Token: FundsUnavailable$/);117118 const balanceSender = await helper.balance.getSubstrateFull(sender.address);119 const balanceReceiver = await helper.balance.getSubstrateFull(receiver.address);120121 // Sender's balance has not changed122 expect(balanceSender.free / nominal).to.eq(999n);123 expect(balanceSender.frozen).to.eq(0n);124 expect(balanceSender.reserved).to.eq(0n);125126 // Receiver's balance has not changed127 expect(balanceReceiver.free).to.be.eq(1n * nominal);128 expect(balanceReceiver.frozen).to.be.eq(0n);129 expect(balanceReceiver.reserved).to.be.eq(0n);130131 // Receiver cannot send vestedTransfer back because of freeze132 await expect(helper.balance.vestedTransfer(receiver, sender.address, schedule)).to.be.rejectedWith(/^Token: FundsUnavailable$/);133 });134135 itSub('cannot send vestedTransfer with incorrect parameters', async ({helper}) => {136 const [sender, receiver] = await helper.arrange.createAccounts([1000n, 1n], donor);137 const incorrectperiodSchedule = {start: 0n, period: 0n, periodCount: 10n, perPeriod: 10n * nominal};138 const incorrectPeriodCountSchedule = {start: 0n, period: 1n, periodCount: 0n, perPeriod: 10n * nominal};139 const incorrectPerPeriodSchedule = {start: 0n, period: 1n, periodCount: 1n, perPeriod: 0n * nominal};140141 await expect(helper.balance.vestedTransfer(sender, sender.address, incorrectperiodSchedule)).to.be.rejectedWith(/vesting.ZeroVestingPeriod/);142 await expect(helper.balance.vestedTransfer(sender, receiver.address, incorrectPeriodCountSchedule)).to.be.rejectedWith(/vesting.ZeroVestingPeriod/);143 await expect(helper.balance.vestedTransfer(sender, receiver.address, incorrectPerPeriodSchedule)).to.be.rejectedWith(/vesting.AmountLow/);144145 const balanceSender = await helper.balance.getSubstrateFull(sender.address);146 // Sender's balance has not changed147 expect(balanceSender.free / nominal).to.eq(999n);148 expect(balanceSender.frozen).to.eq(0n);149 expect(balanceSender.reserved).to.eq(0n);150 });151});