git.delta.rocks / unique-network / refs/commits / 3f7f6aa6cd8e

difftreelog

tests: displace chai-expect header copypasta

Fahrrader2022-09-09parent: #e1baaf9.patch.diff
in: master

15 files changed

modifiedtests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import chai from 'chai';
19import chaiAsPromised from 'chai-as-promised';
20import {itSub, usingPlaygrounds} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {20describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {
26 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedtests/src/fungible.test.tsdiffbeforeafterboth
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {U128_MAX} from './util/helpers';18import {U128_MAX} from './util/helpers';
19import {itSub, usingPlaygrounds} from './util/playgrounds';19import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
20import chai from 'chai';20
21import chaiAsPromised from 'chai-as-promised';21// todo:playgrounds get rid of globals
22
23chai.use(chaiAsPromised);
24const expect = chai.expect;
25
26let alice: IKeyringPair;22let alice: IKeyringPair;
27let bob: IKeyringPair;23let bob: IKeyringPair;
modifiedtests/src/pallet-presence.test.tsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {expect} from 'chai';
18import {itSub, usingPlaygrounds} from './util/playgrounds';17import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
1918
20// Pallets that must always be present19// Pallets that must always be present
21const requiredPallets = [20const requiredPallets = [
modifiedtests/src/refungible.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/playgrounds';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds';
19
20import chai from 'chai';
21import chaiAsPromised from 'chai-as-promised';
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25let alice: IKeyringPair;20let alice: IKeyringPair;
26let bob: IKeyringPair;21let bob: IKeyringPair;
modifiedtests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import chai from 'chai';
18import chaiAsPromised from 'chai-as-promised';
19import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
20import {itSub, usingPlaygrounds} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {20describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {
26 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedtests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import chai from 'chai';
18import chaiAsPromised from 'chai-as-promised';
19import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
20import {itSub, usingPlaygrounds} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('integration test: ext. removeCollectionSponsor():', () => {20describe('integration test: ext. removeCollectionSponsor():', () => {
26 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedtests/src/removeFromAllowList.test.tsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import chai from 'chai';
18import chaiAsPromised from 'chai-as-promised';
19import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
20import {itSub, usingPlaygrounds} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('Integration Test removeFromAllowList', () => {20describe('Integration Test removeFromAllowList', () => {
26 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedtests/src/rpc.test.tsdiffbeforeafterboth
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
2// This file is part of Unique Network.
3
4// Unique Network is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (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 of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
16
1import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
2import chai from 'chai';
3import chaiAsPromised from 'chai-as-promised';
4import {usingPlaygrounds, itSub} from './util/playgrounds';18import {usingPlaygrounds, itSub, expect} from './util/playgrounds';
5import {crossAccountIdFromLower} from './util/playgrounds/unique';19import {crossAccountIdFromLower} from './util/playgrounds/unique';
6
7chai.use(chaiAsPromised);
8const expect = chai.expect;
920
10describe('integration test: RPC methods', () => {21describe('integration test: RPC methods', () => {
11 let donor: IKeyringPair;22 let donor: IKeyringPair;
modifiedtests/src/setCollectionLimits.test.tsdiffbeforeafterboth
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';
19import chai from 'chai';
20import chaiAsPromised from 'chai-as-promised';
21import {itSub, usingPlaygrounds} from './util/playgrounds';19import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
22
23chai.use(chaiAsPromised);
24const expect = chai.expect;
2520
26const accountTokenOwnershipLimit = 0;21const accountTokenOwnershipLimit = 0;
27const sponsoredDataSize = 0;22const sponsoredDataSize = 0;
modifiedtests/src/setCollectionSponsor.test.tsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import chai from 'chai';
18import chaiAsPromised from 'chai-as-promised';
19import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
20import {itSub, usingPlaygrounds, Pallets} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect, Pallets} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('integration test: ext. setCollectionSponsor():', () => {20describe('integration test: ext. setCollectionSponsor():', () => {
26 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedtests/src/setMintPermission.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import chai from 'chai';
19import chaiAsPromised from 'chai-as-promised';
20import {itSub, usingPlaygrounds} from './util/playgrounds';18import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('Integration Test setMintPermission', () => {20describe('Integration Test setMintPermission', () => {
26 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedtests/src/setPublicAccessMode.test.tsdiffbeforeafterboth
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
18import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';
19import chai from 'chai';
20import chaiAsPromised from 'chai-as-promised';
21import {itSub, usingPlaygrounds} from './util/playgrounds';19import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
22
23chai.use(chaiAsPromised);
24const expect = chai.expect;
2520
26describe('Integration Test setPublicAccessMode(): ', () => {21describe('Integration Test setPublicAccessMode(): ', () => {
27 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import chai from 'chai';
19import chaiAsPromised from 'chai-as-promised';
20import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds';18import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds';
21import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds';19import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds';
22
23chai.use(chaiAsPromised);
24const expect = chai.expect;
2520
26describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {21describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
27 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import chai from 'chai';
19import chaiAsPromised from 'chai-as-promised';
20import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds';18import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds';
21
22chai.use(chaiAsPromised);
23const expect = chai.expect;
2419
25describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {20describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {
26 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedtests/src/util/playgrounds/index.tsdiffbeforeafterboth
2// SPDX-License-Identifier: Apache-2.02// SPDX-License-Identifier: Apache-2.0
33
4import {IKeyringPair} from '@polkadot/types/types';4import {IKeyringPair} from '@polkadot/types/types';
5import chai from 'chai';
6import chaiAsPromised from 'chai-as-promised';
5import {Context} from 'mocha';7import {Context} from 'mocha';
6import config from '../../config';8import config from '../../config';
7import '../../interfaces/augment-api-events';9import '../../interfaces/augment-api-events';
8import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev';10import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev';
911
12
13chai.use(chaiAsPromised);
14export const expect = chai.expect;
1015
11export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {16export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
12 const silentConsole = new SilentConsole();17 const silentConsole = new SilentConsole();