From e4eea6c1f0ba083d16a5d20f67f6b6182493f1a9 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Sat, 6 Jan 2024 11:27:55 +0000 Subject: [PATCH] refactor: js-packages structure --- .github/workflows/xcm.yml | 4 +-- js-packages/package.json | 6 +++-- js-packages/playgrounds/package.json | 13 +++++----- .../util => scripts}/authorizeEnactUpgrade.ts | 2 +- .../scripts/benchmarks/mintFee/index.ts | 6 ++--- .../scripts/benchmarks/nesting/index.ts | 2 +- .../scripts/benchmarks/opsFee/index.ts | 4 +-- .../scripts/benchmarks/utils/common.ts | 4 +-- js-packages/scripts/calibrateApply.ts | 2 +- .../{tests/util => scripts}/createHrmp.ts | 4 +-- js-packages/scripts/generateEnv.ts | 2 +- .../{tests/util => scripts}/identitySetter.ts | 4 +-- .../relayIdentitiesChecker.ts | 2 +- .../{tests/util => scripts}/setCode.ts | 2 +- js-packages/scripts/transfer.nload.ts | 4 +-- .../{tests/util => test-utils}/globalSetup.ts | 2 +- .../governance.ts} | 4 +-- .../unique.dev.ts => test-utils/index.ts} | 20 +++++++-------- js-packages/test-utils/package.json | 18 +++++++++++++ .../util/index.ts => test-utils/util.ts} | 8 +++--- .../unique.xcm.ts => test-utils/xcm/index.ts} | 6 ++--- .../types.xcm.ts => test-utils/xcm/types.ts} | 0 js-packages/tests/addCollectionAdmin.test.ts | 4 +-- .../tests/adminTransferAndBurn.test.ts | 2 +- js-packages/tests/allowLists.test.ts | 6 ++--- js-packages/tests/apiConsts.test.ts | 2 +- js-packages/tests/approve.test.ts | 4 +-- js-packages/tests/burnItem.test.ts | 2 +- .../tests/change-collection-owner.test.ts | 4 +-- js-packages/tests/confirmSponsorship.test.ts | 4 +-- js-packages/tests/connection.test.ts | 2 +- js-packages/tests/createCollection.test.ts | 8 +++--- js-packages/tests/createItem.test.ts | 6 ++--- js-packages/tests/createMultipleItems.test.ts | 2 +- .../tests/createMultipleItemsEx.test.ts | 4 +-- .../tests/creditFeesToTreasury.seqtest.ts | 2 +- js-packages/tests/destroyCollection.test.ts | 2 +- .../tests/enableDisableTransfer.test.ts | 2 +- js-packages/tests/eth/allowlist.test.ts | 2 +- js-packages/tests/eth/collectionAdmin.test.ts | 4 +-- .../tests/eth/collectionHelperAddress.test.ts | 2 +- .../tests/eth/collectionLimits.test.ts | 2 +- .../tests/eth/collectionProperties.test.ts | 4 +-- .../tests/eth/collectionSponsoring.test.ts | 2 +- .../tests/eth/contractSponsoring.test.ts | 2 +- .../tests/eth/createCollection.test.ts | 6 ++--- .../tests/eth/createFTCollection.seqtest.ts | 2 +- .../tests/eth/createFTCollection.test.ts | 2 +- .../tests/eth/createRFTCollection.test.ts | 2 +- js-packages/tests/eth/crossTransfer.test.ts | 2 +- .../tests/eth/destroyCollection.test.ts | 4 +-- js-packages/tests/eth/events.test.ts | 4 +-- .../eth/fractionalizer/fractionalizer.test.ts | 2 +- js-packages/tests/eth/getCode.test.ts | 2 +- .../eth/marketplace-v2/marketplace.test.ts | 3 +-- .../tests/eth/marketplace/marketplace.test.ts | 2 +- js-packages/tests/eth/migration.seqtest.ts | 2 +- js-packages/tests/eth/nativeFungible.test.ts | 2 +- js-packages/tests/eth/nonFungible.test.ts | 2 +- js-packages/tests/eth/payable.test.ts | 2 +- .../tests/eth/proxy/fungibleProxy.test.ts | 2 +- .../tests/eth/proxy/nonFungibleProxy.test.ts | 2 +- js-packages/tests/eth/reFungible.test.ts | 4 +-- js-packages/tests/eth/reFungibleToken.test.ts | 2 +- js-packages/tests/eth/scheduling.test.ts | 2 +- js-packages/tests/eth/sponsoring.test.ts | 2 +- js-packages/tests/eth/tokenProperties.test.ts | 6 ++--- .../tests/eth/tokens/callMethodsERC20.test.ts | 2 +- .../eth/tokens/callMethodsERC721.test.ts | 2 +- js-packages/tests/eth/tokens/minting.test.ts | 2 +- js-packages/tests/eth/util/index.ts | 7 +++--- .../tests/eth/util/playgrounds/types.ts | 4 +-- .../tests/eth/util/playgrounds/unique.dev.ts | 4 +-- js-packages/tests/fungible.test.ts | 2 +- js-packages/tests/getPropertiesRpc.test.ts | 4 +-- js-packages/tests/inflation.seqtest.ts | 2 +- js-packages/tests/limits.test.ts | 2 +- js-packages/tests/maintenance.seqtest.ts | 2 +- .../migrations/942057-appPromotion/index.ts | 2 +- .../942057-appPromotion/lockedToFreeze.ts | 2 +- .../correctStateAfterMaintenance.ts | 2 +- .../index.ts} | 4 +-- js-packages/tests/nativeFungible.test.ts | 2 +- js-packages/tests/nextSponsoring.test.ts | 2 +- js-packages/tests/package.json | 6 ++--- js-packages/tests/pallet-presence.test.ts | 2 +- js-packages/tests/performance.seq.test.ts | 6 ++--- js-packages/tests/refungible.test.ts | 2 +- .../tests/removeCollectionAdmin.test.ts | 4 +-- .../tests/removeCollectionSponsor.test.ts | 4 +-- js-packages/tests/rpc.test.ts | 4 +-- js-packages/tests/scheduler.seqtest.ts | 4 +-- js-packages/tests/setCollectionLimits.test.ts | 4 +-- .../tests/setCollectionSponsor.test.ts | 4 +-- js-packages/tests/setPermissions.test.ts | 4 +-- .../sub/appPromotion/appPromotion.seqtest.ts | 2 +- .../sub/appPromotion/appPromotion.test.ts | 4 +-- .../sub/check-event/burnItemEvent.test.ts | 4 +-- .../check-event/createCollectionEvent.test.ts | 4 +-- .../sub/check-event/createItemEvent.test.ts | 4 +-- .../createMultipleItemsEvent.test.ts | 4 +-- .../destroyCollectionEvent.test.ts | 4 +-- .../sub/check-event/transferEvent.test.ts | 4 +-- .../sub/check-event/transferFromEvent.test.ts | 4 +-- .../collatorSelection.seqtest.ts | 2 +- .../collator-selection/identity.seqtest.ts | 4 +-- .../tests/sub/governance/council.test.ts | 4 +-- .../tests/sub/governance/democracy.test.ts | 4 +-- .../tests/sub/governance/electsudo.test.ts | 4 +-- .../tests/sub/governance/fellowship.test.ts | 4 +-- js-packages/tests/sub/governance/init.test.ts | 4 +-- .../sub/governance/technicalCommittee.test.ts | 4 +-- js-packages/tests/sub/governance/util.ts | 6 ++--- js-packages/tests/sub/nesting/admin.test.ts | 4 +-- .../nesting/collectionProperties.seqtest.ts | 2 +- .../sub/nesting/collectionProperties.test.ts | 2 +- js-packages/tests/sub/nesting/common.test.ts | 4 +-- js-packages/tests/sub/nesting/e2e.test.ts | 4 +-- js-packages/tests/sub/nesting/graphs.test.ts | 4 +-- .../sub/nesting/nesting.negative.test.ts | 4 +-- .../sub/nesting/propertyPermissions.test.ts | 4 +-- .../tests/sub/nesting/refungible.test.ts | 2 +- .../sub/nesting/tokenProperties.seqtest.ts | 2 +- .../tests/sub/nesting/tokenProperties.test.ts | 4 +-- js-packages/tests/sub/nesting/unnest.test.ts | 4 +-- .../sub/nesting/unnesting.negative.test.ts | 4 +-- js-packages/tests/sub/refungible/burn.test.ts | 2 +- .../tests/sub/refungible/nesting.test.ts | 2 +- .../tests/sub/refungible/repartition.test.ts | 2 +- .../tests/sub/refungible/transfer.test.ts | 2 +- js-packages/tests/transfer.test.ts | 4 +-- js-packages/tests/transferFrom.test.ts | 4 +-- js-packages/tests/tx-version-presence.test.ts | 2 +- js-packages/tests/vesting.test.ts | 2 +- .../tests/xcm/lowLevelXcmQuartz.test.ts | 2 +- .../tests/xcm/lowLevelXcmUnique.test.ts | 2 +- js-packages/tests/xcm/xcm.types.ts | 5 ++-- js-packages/tests/xcm/xcmOpal.test.ts | 2 +- js-packages/tests/xcm/xcmQuartz.test.ts | 4 +-- js-packages/tests/xcm/xcmUnique.test.ts | 4 +-- js-packages/types/package.json | 2 +- js-packages/yarn.lock | 25 +++++++++++++------ 142 files changed, 275 insertions(+), 248 deletions(-) rename js-packages/{tests/util => scripts}/authorizeEnactUpgrade.ts (91%) rename js-packages/{tests/util => scripts}/createHrmp.ts (91%) rename js-packages/{tests/util => scripts}/identitySetter.ts (98%) rename js-packages/{tests/util => scripts}/relayIdentitiesChecker.ts (98%) rename js-packages/{tests/util => scripts}/setCode.ts (88%) rename js-packages/{tests/util => test-utils}/globalSetup.ts (99%) rename js-packages/{playgrounds/unique.governance.ts => test-utils/governance.ts} (99%) rename js-packages/{playgrounds/unique.dev.ts => test-utils/index.ts} (98%) create mode 100644 js-packages/test-utils/package.json rename js-packages/{tests/util/index.ts => test-utils/util.ts} (98%) rename js-packages/{playgrounds/unique.xcm.ts => test-utils/xcm/index.ts} (98%) rename js-packages/{playgrounds/types.xcm.ts => test-utils/xcm/types.ts} (100%) rename js-packages/tests/{util/frankensteinMigrate.ts => migrations/index.ts} (65%) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 72e2227de3..998a80380c 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -368,9 +368,9 @@ jobs: yarn add mochawesome - name: Call HRMP initialization - working-directory: js-packages/tests + working-directory: js-packages/scripts run: | - yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm util/createHrmp.ts ${{matrix.network}} + yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm createHrmp.ts ${{matrix.network}} - name: Run XCM tests working-directory: js-packages/tests diff --git a/js-packages/package.json b/js-packages/package.json index d928090eb0..96aa7d8d11 100644 --- a/js-packages/package.json +++ b/js-packages/package.json @@ -26,8 +26,9 @@ "@types/node": "^20.8.10", "@typescript-eslint/eslint-plugin": "^6.10.0", "@typescript-eslint/parser": "^6.10.0", - "@unique/opal-types": "workspace:*", - "@unique/playgrounds": "workspace:*", + "@unique-nft/opal-testnet-types": "workspace:*", + "@unique-nft/playgrounds": "workspace:*", + "@unique/test-utils": "workspace:*", "chai": "^4.3.10", "chai-subset": "^1.6.0", "eslint": "^8.53.0", @@ -59,6 +60,7 @@ "types", "playgrounds", "scripts", + "test-utils", "tests" ] } diff --git a/js-packages/playgrounds/package.json b/js-packages/playgrounds/package.json index bb4af8cc33..82e0ae5ed9 100644 --- a/js-packages/playgrounds/package.json +++ b/js-packages/playgrounds/package.json @@ -1,18 +1,17 @@ { - "author": "", - "license": "SEE LICENSE IN ../../../LICENSE", - "description": "Playground scripts", + "author": "Unique Network", + "license": "Apache 2.0", + "description": "Helpers for Unique Network chain", "engines": { - "node": ">=16" + "node": ">=18" }, - "name": "@unique/playgrounds", + "name": "@unique-nft/playgrounds", "type": "module", "version": "1.0.0", "main": "unique.js", "dependencies": { "@polkadot/api": "10.10.1", "@polkadot/util": "^12.5.1", - "@polkadot/util-crypto": "^12.5.1", - "@unique/opal-types": "workspace:*" + "@polkadot/util-crypto": "^12.5.1" } } diff --git a/js-packages/tests/util/authorizeEnactUpgrade.ts b/js-packages/scripts/authorizeEnactUpgrade.ts similarity index 91% rename from js-packages/tests/util/authorizeEnactUpgrade.ts rename to js-packages/scripts/authorizeEnactUpgrade.ts index 3bd854fec1..d1b7b80219 100644 --- a/js-packages/tests/util/authorizeEnactUpgrade.ts +++ b/js-packages/scripts/authorizeEnactUpgrade.ts @@ -1,6 +1,6 @@ import {readFile} from 'fs/promises'; import {u8aToHex} from '@polkadot/util'; -import {usingPlaygrounds} from './index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; import {blake2AsHex} from '@polkadot/util-crypto'; diff --git a/js-packages/scripts/benchmarks/mintFee/index.ts b/js-packages/scripts/benchmarks/mintFee/index.ts index 329c2ecb5d..2fcd88f6c8 100644 --- a/js-packages/scripts/benchmarks/mintFee/index.ts +++ b/js-packages/scripts/benchmarks/mintFee/index.ts @@ -1,13 +1,13 @@ import {usingEthPlaygrounds} from '@unique/tests/eth/util/index.js'; import {EthUniqueHelper} from '@unique/tests/eth/util/playgrounds/unique.dev.js'; import {readFile} from 'fs/promises'; -import type {ICrossAccountId} from '@unique/playgrounds/types.js'; +import type {ICrossAccountId} from '@unique-nft/playgrounds/types.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import {UniqueNFTCollection} from '@unique/playgrounds/unique.js'; +import {UniqueNFTCollection} from '@unique-nft/playgrounds/unique.js'; import {Contract} from 'web3-eth-contract'; import {createObjectCsvWriter} from 'csv-writer'; import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES} from '../utils/common.js'; -import {makeNames} from '@unique/tests/util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; import type {ContractImports} from '@unique/tests/eth/util/playgrounds/types.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/scripts/benchmarks/nesting/index.ts b/js-packages/scripts/benchmarks/nesting/index.ts index 9fc72b559d..8a4fedc28c 100644 --- a/js-packages/scripts/benchmarks/nesting/index.ts +++ b/js-packages/scripts/benchmarks/nesting/index.ts @@ -4,7 +4,7 @@ import {readFile} from 'fs/promises'; import type {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; import {convertToTokens} from '../utils/common.js'; -import {makeNames} from '@unique/tests/util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; import type {ContractImports} from '@unique/tests/eth/util/playgrounds/types.js'; import type {RMRKNestableMintable} from './ABIGEN/index.js'; diff --git a/js-packages/scripts/benchmarks/opsFee/index.ts b/js-packages/scripts/benchmarks/opsFee/index.ts index 848ee47fb1..0670e35045 100644 --- a/js-packages/scripts/benchmarks/opsFee/index.ts +++ b/js-packages/scripts/benchmarks/opsFee/index.ts @@ -3,13 +3,13 @@ import {EthUniqueHelper} from '@unique/tests/eth/util/playgrounds/unique.dev.js' import {readFile} from 'fs/promises'; import {CollectionLimitField, CreateCollectionData, TokenPermissionField} from '@unique/tests/eth/util/playgrounds/types.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import {UniqueFTCollection, UniqueNFTCollection} from '@unique/playgrounds/unique.js'; +import {UniqueFTCollection, UniqueNFTCollection} from '@unique-nft/playgrounds/unique.js'; import {Contract} from 'web3-eth-contract'; import {createObjectCsvWriter} from 'csv-writer'; import {FunctionFeeVM} from '../utils/types.js'; import type {IFunctionFee} from '../utils/types.js'; import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES, SUBS_PROPERTIES} from '../utils/common.js'; -import {makeNames} from '@unique/tests/util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/scripts/benchmarks/utils/common.ts b/js-packages/scripts/benchmarks/utils/common.ts index 8661f799d6..a16e6ca560 100644 --- a/js-packages/scripts/benchmarks/utils/common.ts +++ b/js-packages/scripts/benchmarks/utils/common.ts @@ -1,6 +1,6 @@ import {EthUniqueHelper} from '@unique/tests/eth/util/playgrounds/unique.dev.js'; -import {UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/unique.js'; -import type {ITokenPropertyPermission, TCollectionMode} from '@unique/playgrounds/types.js'; +import {UniqueNFTCollection, UniqueRFTCollection} from '@unique-nft/playgrounds/unique.js'; +import type {ITokenPropertyPermission, TCollectionMode} from '@unique-nft/playgrounds/types.js'; import type {IKeyringPair} from '@polkadot/types/types'; export const PROPERTIES = Array(40) diff --git a/js-packages/scripts/calibrateApply.ts b/js-packages/scripts/calibrateApply.ts index 96abb37dc0..25539f74fb 100644 --- a/js-packages/scripts/calibrateApply.ts +++ b/js-packages/scripts/calibrateApply.ts @@ -1,6 +1,6 @@ import {readFile, writeFile} from 'fs/promises'; import path from 'path'; -import {makeNames, usingPlaygrounds} from '@unique/tests/util/index.js'; +import {makeNames, usingPlaygrounds} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/util/createHrmp.ts b/js-packages/scripts/createHrmp.ts similarity index 91% rename from js-packages/tests/util/createHrmp.ts rename to js-packages/scripts/createHrmp.ts index 57d03cc781..7a131d0543 100644 --- a/js-packages/tests/util/createHrmp.ts +++ b/js-packages/scripts/createHrmp.ts @@ -1,5 +1,5 @@ -import {usingPlaygrounds} from './index.js'; -import config from '../config.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; +import config from '../tests/config.js'; const profile = process.argv[2]; if(!profile) throw new Error('missing profile/relay argument'); diff --git a/js-packages/scripts/generateEnv.ts b/js-packages/scripts/generateEnv.ts index 682f88cc2f..b621ccd47f 100644 --- a/js-packages/scripts/generateEnv.ts +++ b/js-packages/scripts/generateEnv.ts @@ -1,7 +1,7 @@ import {ApiPromise, WsProvider} from '@polkadot/api'; import {readFile} from 'fs/promises'; import {join} from 'path'; -import {makeNames} from '@unique/tests/util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/util/identitySetter.ts b/js-packages/scripts/identitySetter.ts similarity index 98% rename from js-packages/tests/util/identitySetter.ts rename to js-packages/scripts/identitySetter.ts index eec506b989..f7180104d4 100644 --- a/js-packages/tests/util/identitySetter.ts +++ b/js-packages/scripts/identitySetter.ts @@ -9,8 +9,8 @@ import {encodeAddress} from '@polkadot/keyring'; import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, Pallets} from './index.js'; -import {ChainHelperBase} from '@unique/playgrounds/unique.js'; +import {usingPlaygrounds, Pallets} from '@unique/test-utils/util.js'; +import {ChainHelperBase} from '@unique-nft/playgrounds/unique.js'; const relayUrl = process.argv[2] ?? 'ws://localhost:9844'; const paraUrl = process.argv[3] ?? 'ws://localhost:9944'; diff --git a/js-packages/tests/util/relayIdentitiesChecker.ts b/js-packages/scripts/relayIdentitiesChecker.ts similarity index 98% rename from js-packages/tests/util/relayIdentitiesChecker.ts rename to js-packages/scripts/relayIdentitiesChecker.ts index c2003d5c3e..95653cc415 100644 --- a/js-packages/tests/util/relayIdentitiesChecker.ts +++ b/js-packages/scripts/relayIdentitiesChecker.ts @@ -7,7 +7,7 @@ // Example: `yarn checkRelayIdentities wss://polkadot-rpc.dwellir.com wss://kusama-rpc.dwellir.com` import {encodeAddress} from '@polkadot/keyring'; -import {usingPlaygrounds} from './index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; import {getIdentities, getSubs, getSupers, constructSubInfo} from './identitySetter.js'; const relay1Url = process.argv[2] ?? 'ws://localhost:9844'; diff --git a/js-packages/tests/util/setCode.ts b/js-packages/scripts/setCode.ts similarity index 88% rename from js-packages/tests/util/setCode.ts rename to js-packages/scripts/setCode.ts index c7b09494c6..9b3917be70 100644 --- a/js-packages/tests/util/setCode.ts +++ b/js-packages/scripts/setCode.ts @@ -1,6 +1,6 @@ import {readFile} from 'fs/promises'; import {u8aToHex} from '@polkadot/util'; -import {usingPlaygrounds} from './index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; const codePath = process.argv[2]; if(!codePath) throw new Error('missing code path argument'); diff --git a/js-packages/scripts/transfer.nload.ts b/js-packages/scripts/transfer.nload.ts index 8878d07aab..5ef0b71fb2 100644 --- a/js-packages/scripts/transfer.nload.ts +++ b/js-packages/scripts/transfer.nload.ts @@ -17,8 +17,8 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ import os from 'os'; import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds} from '@unique/tests/util/index.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; import * as notReallyCluster from 'cluster'; // https://github.com/nodejs/node/issues/42271#issuecomment-1063415346 const cluster = notReallyCluster as unknown as notReallyCluster.Cluster; diff --git a/js-packages/tests/util/globalSetup.ts b/js-packages/test-utils/globalSetup.ts similarity index 99% rename from js-packages/tests/util/globalSetup.ts rename to js-packages/test-utils/globalSetup.ts index ab7008158d..22191d93ed 100644 --- a/js-packages/tests/util/globalSetup.ts +++ b/js-packages/test-utils/globalSetup.ts @@ -3,7 +3,7 @@ import { usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND, LOCKING_PERIOD, UNLOCKING_PERIOD, makeNames, -} from './index.js'; +} from './util.js'; import * as path from 'path'; import {promises as fs} from 'fs'; diff --git a/js-packages/playgrounds/unique.governance.ts b/js-packages/test-utils/governance.ts similarity index 99% rename from js-packages/playgrounds/unique.governance.ts rename to js-packages/test-utils/governance.ts index e3fa2508f2..fef76e7122 100644 --- a/js-packages/playgrounds/unique.governance.ts +++ b/js-packages/test-utils/governance.ts @@ -1,7 +1,7 @@ import {blake2AsHex} from '@polkadot/util-crypto'; import type {PalletDemocracyConviction} from '@polkadot/types/lookup'; -import type {IPhasicEvent, TSigner} from './types.js'; -import {HelperGroup, UniqueHelper} from './unique.js'; +import type {IPhasicEvent, TSigner} from '@unique-nft/playgrounds/types.js'; +import {HelperGroup, UniqueHelper} from '@unique-nft/playgrounds/unique.js'; export class CollectiveGroup extends HelperGroup { /** diff --git a/js-packages/playgrounds/unique.dev.ts b/js-packages/test-utils/index.ts similarity index 98% rename from js-packages/playgrounds/unique.dev.ts rename to js-packages/test-utils/index.ts index 8a4d7e3c6b..ec928610e7 100644 --- a/js-packages/playgrounds/unique.dev.ts +++ b/js-packages/test-utils/index.ts @@ -1,25 +1,25 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 -import '@unique/opal-types/augment-api.js'; -import '@unique/opal-types/augment-types.js'; -import '@unique/opal-types/types-lookup.js'; +import '@unique-nft/opal-testnet-types/augment-api.js'; +import '@unique-nft/opal-testnet-types/augment-types.js'; +import '@unique-nft/opal-testnet-types/types-lookup.js'; import {stringToU8a} from '@polkadot/util'; import {blake2AsHex, encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; -import type {ChainHelperBaseConstructor, UniqueHelperConstructor} from './unique.js'; -import {UniqueHelper, ChainHelperBase, HelperGroup} from './unique.js'; +import type {ChainHelperBaseConstructor, UniqueHelperConstructor} from '@unique-nft/playgrounds/unique.js'; +import {UniqueHelper, ChainHelperBase, HelperGroup} from '@unique-nft/playgrounds/unique.js'; import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; -import * as defs from '@unique/opal-types/definitions.js'; +import * as defs from '@unique-nft/opal-testnet-types/definitions.js'; import type {IKeyringPair} from '@polkadot/types/types'; import type {EventRecord} from '@polkadot/types/interfaces'; -import type {ICrossAccountId, ILogger, IPovInfo, ISchedulerOptions, ITransactionResult, TSigner} from './types.js'; +import type {ICrossAccountId, ILogger, IPovInfo, ISchedulerOptions, ITransactionResult, TSigner} from '@unique-nft/playgrounds/types.js'; import type {FrameSystemEventRecord, StagingXcmV2TraitsError, StagingXcmV3TraitsOutcome} from '@polkadot/types/lookup'; import type {SignerOptions, VoidFn} from '@polkadot/api/types'; import {spawnSync} from 'child_process'; -import {AcalaHelper, AstarHelper, MoonbeamHelper, PolkadexHelper, RelayHelper, WestmintHelper, ForeignAssetsGroup, XcmGroup, XTokensGroup, TokensGroup, HydraDxHelper} from './unique.xcm.js'; -import {CollectiveGroup, CollectiveMembershipGroup, DemocracyGroup, RankedCollectiveGroup, ReferendaGroup} from './unique.governance.js'; -import type {ICollectiveGroup, IFellowshipGroup} from './unique.governance.js'; +import {AcalaHelper, AstarHelper, MoonbeamHelper, PolkadexHelper, RelayHelper, WestmintHelper, ForeignAssetsGroup, XcmGroup, XTokensGroup, TokensGroup, HydraDxHelper} from './xcm/index.js'; +import {CollectiveGroup, CollectiveMembershipGroup, DemocracyGroup, RankedCollectiveGroup, ReferendaGroup} from './governance.js'; +import type {ICollectiveGroup, IFellowshipGroup} from './governance.js'; export class SilentLogger { log(_msg: any, _level: any): void { } diff --git a/js-packages/test-utils/package.json b/js-packages/test-utils/package.json new file mode 100644 index 0000000000..6e2f4e588d --- /dev/null +++ b/js-packages/test-utils/package.json @@ -0,0 +1,18 @@ +{ + "author": "", + "license": "SEE LICENSE IN ../../../LICENSE", + "description": "Playground scripts", + "engines": { + "node": ">=16" + }, + "name": "@unique/test-utils", + "type": "module", + "version": "1.0.0", + "main": "index.js", + "dependencies": { + "@polkadot/api": "10.10.1", + "@polkadot/util": "^12.5.1", + "@polkadot/util-crypto": "^12.5.1", + "@unique-nft/opal-testnet-types": "workspace:*" + } +} diff --git a/js-packages/tests/util/index.ts b/js-packages/test-utils/util.ts similarity index 98% rename from js-packages/tests/util/index.ts rename to js-packages/test-utils/util.ts index 293c67aa6b..8836c1136f 100644 --- a/js-packages/tests/util/index.ts +++ b/js-packages/test-utils/util.ts @@ -8,10 +8,10 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiSubset from 'chai-subset'; import {Context} from 'mocha'; -import config from '../config.js'; -import {ChainHelperBase} from '@unique/playgrounds/unique.js'; -import type {ILogger} from '@unique/playgrounds/types.js'; -import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper, DevWestmintHelper, DevStatemineHelper, DevStatemintHelper, DevAstarHelper, DevShidenHelper, DevPolkadexHelper, DevHydraDxHelper} from '@unique/playgrounds/unique.dev.js'; +import config from '../tests/config.js'; +import {ChainHelperBase} from '@unique-nft/playgrounds/unique.js'; +import type {ILogger} from '@unique-nft/playgrounds/types.js'; +import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper, DevWestmintHelper, DevStatemineHelper, DevStatemintHelper, DevAstarHelper, DevShidenHelper, DevPolkadexHelper, DevHydraDxHelper} from '@unique/test-utils'; import {dirname} from 'path'; import {fileURLToPath} from 'url'; diff --git a/js-packages/playgrounds/unique.xcm.ts b/js-packages/test-utils/xcm/index.ts similarity index 98% rename from js-packages/playgrounds/unique.xcm.ts rename to js-packages/test-utils/xcm/index.ts index f8dc453f98..a48e6b233f 100644 --- a/js-packages/playgrounds/unique.xcm.ts +++ b/js-packages/test-utils/xcm/index.ts @@ -1,8 +1,8 @@ import {ApiPromise, WsProvider} from '@polkadot/api'; import type {IKeyringPair} from '@polkadot/types/types'; -import {ChainHelperBase, EthereumBalanceGroup, HelperGroup, SubstrateBalanceGroup, UniqueHelper} from './unique.js'; -import type {ILogger, TSigner, TSubstrateAccount} from './types.js'; -import type {AcalaAssetMetadata, DemocracyStandardAccountVote, MoonbeamAssetInfo} from './types.xcm.js'; +import {ChainHelperBase, EthereumBalanceGroup, HelperGroup, SubstrateBalanceGroup, UniqueHelper} from '@unique-nft/playgrounds/unique.js'; +import type {ILogger, TSigner} from '@unique-nft/playgrounds/types.js'; +import type {AcalaAssetMetadata, DemocracyStandardAccountVote, MoonbeamAssetInfo} from './types.js'; export class XcmChainHelper extends ChainHelperBase { diff --git a/js-packages/playgrounds/types.xcm.ts b/js-packages/test-utils/xcm/types.ts similarity index 100% rename from js-packages/playgrounds/types.xcm.ts rename to js-packages/test-utils/xcm/types.ts diff --git a/js-packages/tests/addCollectionAdmin.test.ts b/js-packages/tests/addCollectionAdmin.test.ts index d53f36622b..aaa91d2a15 100644 --- a/js-packages/tests/addCollectionAdmin.test.ts +++ b/js-packages/tests/addCollectionAdmin.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/adminTransferAndBurn.test.ts b/js-packages/tests/adminTransferAndBurn.test.ts index bf60b55d4c..7b1f4f606d 100644 --- a/js-packages/tests/adminTransferAndBurn.test.ts +++ b/js-packages/tests/adminTransferAndBurn.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/index.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/allowLists.test.ts b/js-packages/tests/allowLists.test.ts index 4c2f899c4c..498b1b88df 100644 --- a/js-packages/tests/allowLists.test.ts +++ b/js-packages/tests/allowLists.test.ts @@ -15,9 +15,9 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/index.js'; -import type {ICollectionPermissions} from '@unique/playgrounds/types.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; +import type {ICollectionPermissions} from '@unique-nft/playgrounds/types.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test ext. Allow list tests', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/apiConsts.test.ts b/js-packages/tests/apiConsts.test.ts index f87cb0f18d..c54deef5d9 100644 --- a/js-packages/tests/apiConsts.test.ts +++ b/js-packages/tests/apiConsts.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {ApiPromise} from '@polkadot/api'; -import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from './util/index.js'; +import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from '@unique/test-utils/util.js'; const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n; diff --git a/js-packages/tests/approve.test.ts b/js-packages/tests/approve.test.ts index cd1a176c68..074f07d51e 100644 --- a/js-packages/tests/approve.test.ts +++ b/js-packages/tests/approve.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from './util/index.js'; -import {CrossAccountId} from '@unique/playgrounds/unique.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId} from '@unique-nft/playgrounds/unique.js'; diff --git a/js-packages/tests/burnItem.test.ts b/js-packages/tests/burnItem.test.ts index 82551d06e2..4046c03ad9 100644 --- a/js-packages/tests/burnItem.test.ts +++ b/js-packages/tests/burnItem.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/index.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('integration test: ext. burnItem():', () => { diff --git a/js-packages/tests/change-collection-owner.test.ts b/js-packages/tests/change-collection-owner.test.ts index 2c1c97111b..9ca3479d09 100644 --- a/js-packages/tests/change-collection-owner.test.ts +++ b/js-packages/tests/change-collection-owner.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/confirmSponsorship.test.ts b/js-packages/tests/confirmSponsorship.test.ts index 4f471acd52..315cfc3e25 100644 --- a/js-packages/tests/confirmSponsorship.test.ts +++ b/js-packages/tests/confirmSponsorship.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub, Pallets} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) { await collection.setSponsor(signer, sponsorAddress); diff --git a/js-packages/tests/connection.test.ts b/js-packages/tests/connection.test.ts index 48ee110ed9..848efa1b67 100644 --- a/js-packages/tests/connection.test.ts +++ b/js-packages/tests/connection.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itSub, expect, usingPlaygrounds} from './util/index.js'; +import {itSub, expect, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('Connection smoke test', () => { itSub('Connection can be established', async ({helper}) => { diff --git a/js-packages/tests/createCollection.test.ts b/js-packages/tests/createCollection.test.ts index e340dccb6b..81cb5234cc 100644 --- a/js-packages/tests/createCollection.test.ts +++ b/js-packages/tests/createCollection.test.ts @@ -15,10 +15,10 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js'; -import {CollectionFlag} from '@unique/playgrounds/types.js'; -import type {ICollectionCreationOptions, IProperty} from '@unique/playgrounds/types.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {usingPlaygrounds, expect, itSub, Pallets} from '@unique/test-utils/util.js'; +import {CollectionFlag} from '@unique-nft/playgrounds/types.js'; +import type {ICollectionCreationOptions, IProperty} from '@unique-nft/playgrounds/types.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') { let collection; diff --git a/js-packages/tests/createItem.test.ts b/js-packages/tests/createItem.test.ts index 5b15792a18..8252b6d6ce 100644 --- a/js-packages/tests/createItem.test.ts +++ b/js-packages/tests/createItem.test.ts @@ -15,9 +15,9 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js'; -import type {IProperty, ICrossAccountId} from '@unique/playgrounds/types.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {usingPlaygrounds, expect, itSub, Pallets} from '@unique/test-utils/util.js'; +import type {IProperty, ICrossAccountId} from '@unique-nft/playgrounds/types.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; async function mintTokenHelper(helper: UniqueHelper, collection: any, signer: IKeyringPair, owner: ICrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) { let token; diff --git a/js-packages/tests/createMultipleItems.test.ts b/js-packages/tests/createMultipleItems.test.ts index 6df4480493..4acdbba8cc 100644 --- a/js-packages/tests/createMultipleItems.test.ts +++ b/js-packages/tests/createMultipleItems.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, Pallets, itSub} from './util/index.js'; +import {usingPlaygrounds, expect, Pallets, itSub} from '@unique/test-utils/util.js'; describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/createMultipleItemsEx.test.ts b/js-packages/tests/createMultipleItemsEx.test.ts index 9bd8f9e7cb..fb924de7bb 100644 --- a/js-packages/tests/createMultipleItemsEx.test.ts +++ b/js-packages/tests/createMultipleItemsEx.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, Pallets, itSub} from './util/index.js'; -import type {IProperty} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, Pallets, itSub} from '@unique/test-utils/util.js'; +import type {IProperty} from '@unique-nft/playgrounds/types.js'; describe('Integration Test: createMultipleItemsEx', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/creditFeesToTreasury.seqtest.ts b/js-packages/tests/creditFeesToTreasury.seqtest.ts index 5a8a26fd42..e4e4856f96 100644 --- a/js-packages/tests/creditFeesToTreasury.seqtest.ts +++ b/js-packages/tests/creditFeesToTreasury.seqtest.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise} from '@polkadot/api'; -import {usingPlaygrounds, expect, itSub} from './util/index.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; import type {u32} from '@polkadot/types-codec'; const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z'; diff --git a/js-packages/tests/destroyCollection.test.ts b/js-packages/tests/destroyCollection.test.ts index 06ad8a7e0a..f2a8e6e248 100644 --- a/js-packages/tests/destroyCollection.test.ts +++ b/js-packages/tests/destroyCollection.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, expect, usingPlaygrounds, Pallets} from './util/index.js'; +import {itSub, expect, usingPlaygrounds, Pallets} from '@unique/test-utils/util.js'; describe('integration test: ext. destroyCollection():', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/enableDisableTransfer.test.ts b/js-packages/tests/enableDisableTransfer.test.ts index 325269a95a..4880c450f8 100644 --- a/js-packages/tests/enableDisableTransfer.test.ts +++ b/js-packages/tests/enableDisableTransfer.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; describe('Enable/Disable Transfers', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/eth/allowlist.test.ts b/js-packages/tests/eth/allowlist.test.ts index b21367e5a8..56cf17731f 100644 --- a/js-packages/tests/eth/allowlist.test.ts +++ b/js-packages/tests/eth/allowlist.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets} from '../util/index.js'; +import {Pallets} from '@unique/test-utils/util.js'; import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util/index.js'; import {CreateCollectionData} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/collectionAdmin.test.ts b/js-packages/tests/eth/collectionAdmin.test.ts index 38f73697ae..3cbb1c0cda 100644 --- a/js-packages/tests/eth/collectionAdmin.test.ts +++ b/js-packages/tests/eth/collectionAdmin.test.ts @@ -15,8 +15,8 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; -import {Pallets} from '../util/index.js'; -import type {IEthCrossAccountId} from '@unique/playgrounds/types.js'; +import {Pallets} from '@unique/test-utils/util.js'; +import type {IEthCrossAccountId} from '@unique-nft/playgrounds/types.js'; import {usingEthPlaygrounds, itEth} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; import {CreateCollectionData} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/collectionHelperAddress.test.ts b/js-packages/tests/eth/collectionHelperAddress.test.ts index 899d6d1e36..4a2082b83b 100644 --- a/js-packages/tests/eth/collectionHelperAddress.test.ts +++ b/js-packages/tests/eth/collectionHelperAddress.test.ts @@ -16,7 +16,7 @@ import {itEth, usingEthPlaygrounds, expect} from './util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import {COLLECTION_HELPER, Pallets} from '../util/index.js'; +import {COLLECTION_HELPER, Pallets} from '@unique/test-utils/util.js'; describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/eth/collectionLimits.test.ts b/js-packages/tests/eth/collectionLimits.test.ts index d1e69e35b0..df850a0bf4 100644 --- a/js-packages/tests/eth/collectionLimits.test.ts +++ b/js-packages/tests/eth/collectionLimits.test.ts @@ -1,5 +1,5 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets} from '../util/index.js'; +import {Pallets} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import {CollectionLimitField, CreateCollectionData} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/collectionProperties.test.ts b/js-packages/tests/eth/collectionProperties.test.ts index 1740b30a21..7c66123297 100644 --- a/js-packages/tests/eth/collectionProperties.test.ts +++ b/js-packages/tests/eth/collectionProperties.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {itEth, usingEthPlaygrounds, expect} from './util/index.js'; -import {Pallets} from '../util/index.js'; -import type {IProperty, ITokenPropertyPermission} from '@unique/playgrounds/types.js'; +import {Pallets} from '@unique/test-utils/util.js'; +import type {IProperty, ITokenPropertyPermission} from '@unique-nft/playgrounds/types.js'; import type {IKeyringPair} from '@polkadot/types/types'; describe('EVM collection properties', () => { diff --git a/js-packages/tests/eth/collectionSponsoring.test.ts b/js-packages/tests/eth/collectionSponsoring.test.ts index 8f1b653c69..b05f67dac4 100644 --- a/js-packages/tests/eth/collectionSponsoring.test.ts +++ b/js-packages/tests/eth/collectionSponsoring.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip, usingPlaygrounds} from '@unique/test-utils/util.js'; import {itEth, expect} from './util/index.js'; import {CollectionLimitField, TokenPermissionField} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/contractSponsoring.test.ts b/js-packages/tests/eth/contractSponsoring.test.ts index ea3b3daae2..5a3b5bc582 100644 --- a/js-packages/tests/eth/contractSponsoring.test.ts +++ b/js-packages/tests/eth/contractSponsoring.test.ts @@ -17,7 +17,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from './util/index.js'; -import {usingPlaygrounds} from '../util/index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; import type {CompiledContract} from './util/playgrounds/types.js'; describe('Sponsoring EVM contracts', () => { diff --git a/js-packages/tests/eth/createCollection.test.ts b/js-packages/tests/eth/createCollection.test.ts index e43c6c69b7..eebf02b9c1 100644 --- a/js-packages/tests/eth/createCollection.test.ts +++ b/js-packages/tests/eth/createCollection.test.ts @@ -16,11 +16,11 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {evmToAddress} from '@polkadot/util-crypto'; -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import {CREATE_COLLECTION_DATA_DEFAULTS, CollectionLimitField, CollectionMode, CreateCollectionData, TokenPermissionField, emptyAddress} from './util/playgrounds/types.js'; -import {CollectionFlag} from '@unique/playgrounds/types.js'; -import type {IEthCrossAccountId, TCollectionMode} from '@unique/playgrounds/types.js'; +import {CollectionFlag} from '@unique-nft/playgrounds/types.js'; +import type {IEthCrossAccountId, TCollectionMode} from '@unique-nft/playgrounds/types.js'; const DECIMALS = 18; const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [ diff --git a/js-packages/tests/eth/createFTCollection.seqtest.ts b/js-packages/tests/eth/createFTCollection.seqtest.ts index edf9969928..bc85f242af 100644 --- a/js-packages/tests/eth/createFTCollection.seqtest.ts +++ b/js-packages/tests/eth/createFTCollection.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; const DECIMALS = 18; diff --git a/js-packages/tests/eth/createFTCollection.test.ts b/js-packages/tests/eth/createFTCollection.test.ts index e758856e11..c49580b7ea 100644 --- a/js-packages/tests/eth/createFTCollection.test.ts +++ b/js-packages/tests/eth/createFTCollection.test.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {evmToAddress} from '@polkadot/util-crypto'; -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import {CollectionLimitField} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/createRFTCollection.test.ts b/js-packages/tests/eth/createRFTCollection.test.ts index c8ec871f80..07182593c5 100644 --- a/js-packages/tests/eth/createRFTCollection.test.ts +++ b/js-packages/tests/eth/createRFTCollection.test.ts @@ -16,7 +16,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import {CollectionLimitField} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/crossTransfer.test.ts b/js-packages/tests/eth/crossTransfer.test.ts index d6379060a5..a4cd438bb2 100644 --- a/js-packages/tests/eth/crossTransfer.test.ts +++ b/js-packages/tests/eth/crossTransfer.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {itEth, usingEthPlaygrounds} from './util/index.js'; -import {CrossAccountId} from '@unique/playgrounds/unique.js'; +import {CrossAccountId} from '@unique-nft/playgrounds/unique.js'; import type {IKeyringPair} from '@polkadot/types/types'; describe('Token transfer between substrate address and EVM address. Fungible', () => { diff --git a/js-packages/tests/eth/destroyCollection.test.ts b/js-packages/tests/eth/destroyCollection.test.ts index ccb41148b4..01438a12a2 100644 --- a/js-packages/tests/eth/destroyCollection.test.ts +++ b/js-packages/tests/eth/destroyCollection.test.ts @@ -15,9 +15,9 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets} from '../util/index.js'; +import {Pallets} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; -import type {TCollectionMode} from '@unique/playgrounds/types.js'; +import type {TCollectionMode} from '@unique-nft/playgrounds/types.js'; import {CreateCollectionData} from './util/playgrounds/types.js'; describe('Destroy Collection from EVM', function() { diff --git a/js-packages/tests/eth/events.test.ts b/js-packages/tests/eth/events.test.ts index 78ef52fff8..1ea7edcf5b 100644 --- a/js-packages/tests/eth/events.test.ts +++ b/js-packages/tests/eth/events.test.ts @@ -18,8 +18,8 @@ import {expect} from 'chai'; import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, usingEthPlaygrounds} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; -import type {IEvent, TCollectionMode} from '@unique/playgrounds/types.js'; -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import type {IEvent, TCollectionMode} from '@unique-nft/playgrounds/types.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {CollectionLimitField, TokenPermissionField, CreateCollectionData} from './util/playgrounds/types.js'; import type {NormalizedEvent} from './util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/fractionalizer/fractionalizer.test.ts b/js-packages/tests/eth/fractionalizer/fractionalizer.test.ts index 84024daa3e..753ee46c28 100644 --- a/js-packages/tests/eth/fractionalizer/fractionalizer.test.ts +++ b/js-packages/tests/eth/fractionalizer/fractionalizer.test.ts @@ -25,7 +25,7 @@ import {Contract} from 'web3-eth-contract'; import {usingEthPlaygrounds, expect, itEth} from '../util/index.js'; import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js'; import type {CompiledContract} from '../util/playgrounds/types.js'; -import {requirePalletsOrSkip, Pallets, makeNames} from '../../util/index.js'; +import {requirePalletsOrSkip, Pallets, makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/getCode.test.ts b/js-packages/tests/eth/getCode.test.ts index 61fdb1f8e8..3da3369e3f 100644 --- a/js-packages/tests/eth/getCode.test.ts +++ b/js-packages/tests/eth/getCode.test.ts @@ -16,7 +16,7 @@ import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import {COLLECTION_HELPER, CONTRACT_HELPER} from '../util/index.js'; +import {COLLECTION_HELPER, CONTRACT_HELPER} from '@unique/test-utils/util.js'; describe('RPC eth_getCode', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/eth/marketplace-v2/marketplace.test.ts b/js-packages/tests/eth/marketplace-v2/marketplace.test.ts index 0763f760d9..a695d57216 100644 --- a/js-packages/tests/eth/marketplace-v2/marketplace.test.ts +++ b/js-packages/tests/eth/marketplace-v2/marketplace.test.ts @@ -19,8 +19,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; import {SponsoringMode, itEth, usingEthPlaygrounds} from '../util/index.js'; import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js'; -import {makeNames} from '../../util/index.js'; -import {expect} from 'chai'; +import {makeNames, expect} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/marketplace/marketplace.test.ts b/js-packages/tests/eth/marketplace/marketplace.test.ts index 65ff90af53..f5289e5051 100644 --- a/js-packages/tests/eth/marketplace/marketplace.test.ts +++ b/js-packages/tests/eth/marketplace/marketplace.test.ts @@ -17,7 +17,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util/index.js'; -import {makeNames} from '../../util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/migration.seqtest.ts b/js-packages/tests/eth/migration.seqtest.ts index adb1da9807..d7bbbe65d5 100644 --- a/js-packages/tests/eth/migration.seqtest.ts +++ b/js-packages/tests/eth/migration.seqtest.ts @@ -18,7 +18,7 @@ import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; import {Struct} from '@polkadot/types'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; import type {InterfaceTypes} from '@polkadot/types/types/registry'; import {ApiPromise} from '@polkadot/api'; diff --git a/js-packages/tests/eth/nativeFungible.test.ts b/js-packages/tests/eth/nativeFungible.test.ts index 36049d1445..87449da526 100644 --- a/js-packages/tests/eth/nativeFungible.test.ts +++ b/js-packages/tests/eth/nativeFungible.test.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; describe('NativeFungible: ERC20 calls', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/eth/nonFungible.test.ts b/js-packages/tests/eth/nonFungible.test.ts index c045fc0092..17a3d02b8d 100644 --- a/js-packages/tests/eth/nonFungible.test.ts +++ b/js-packages/tests/eth/nonFungible.test.ts @@ -18,7 +18,7 @@ import {itEth, usingEthPlaygrounds, expect} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; import type {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import type {ITokenPropertyPermission} from '@unique/playgrounds/types.js'; +import type {ITokenPropertyPermission} from '@unique-nft/playgrounds/types.js'; import {CREATE_COLLECTION_DATA_DEFAULTS, TokenPermissionField} from './util/playgrounds/types.js'; describe('Check ERC721 token URI for NFT', () => { diff --git a/js-packages/tests/eth/payable.test.ts b/js-packages/tests/eth/payable.test.ts index 6dbf0ecc4e..eb7cac2196 100644 --- a/js-packages/tests/eth/payable.test.ts +++ b/js-packages/tests/eth/payable.test.ts @@ -18,7 +18,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, expect, usingEthPlaygrounds} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; -import {makeNames} from '../util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/proxy/fungibleProxy.test.ts b/js-packages/tests/eth/proxy/fungibleProxy.test.ts index bcf7d37889..d41e5897bb 100644 --- a/js-packages/tests/eth/proxy/fungibleProxy.test.ts +++ b/js-packages/tests/eth/proxy/fungibleProxy.test.ts @@ -19,7 +19,7 @@ import {readFile} from 'fs/promises'; import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, usingEthPlaygrounds} from '../util/index.js'; import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js'; -import {makeNames} from '../../util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/proxy/nonFungibleProxy.test.ts b/js-packages/tests/eth/proxy/nonFungibleProxy.test.ts index 3acc0dfdd9..bb3e7a2f7a 100644 --- a/js-packages/tests/eth/proxy/nonFungibleProxy.test.ts +++ b/js-packages/tests/eth/proxy/nonFungibleProxy.test.ts @@ -18,7 +18,7 @@ import {readFile} from 'fs/promises'; import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, usingEthPlaygrounds, expect} from '../util/index.js'; import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js'; -import {makeNames} from '../../util/index.js'; +import {makeNames} from '@unique/test-utils/util.js'; const {dirname} = makeNames(import.meta.url); diff --git a/js-packages/tests/eth/reFungible.test.ts b/js-packages/tests/eth/reFungible.test.ts index 1b3a19b464..c889b449b9 100644 --- a/js-packages/tests/eth/reFungible.test.ts +++ b/js-packages/tests/eth/reFungible.test.ts @@ -14,10 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import type {ITokenPropertyPermission} from '@unique/playgrounds/types.js'; +import type {ITokenPropertyPermission} from '@unique-nft/playgrounds/types.js'; import {CREATE_COLLECTION_DATA_DEFAULTS, TokenPermissionField} from './util/playgrounds/types.js'; describe('Refungible: Plain calls', () => { diff --git a/js-packages/tests/eth/reFungibleToken.test.ts b/js-packages/tests/eth/reFungibleToken.test.ts index d30113189b..3973c6049d 100644 --- a/js-packages/tests/eth/reFungibleToken.test.ts +++ b/js-packages/tests/eth/reFungibleToken.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets, requirePalletsOrSkip} from '../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; import type {IKeyringPair} from '@polkadot/types/types'; diff --git a/js-packages/tests/eth/scheduling.test.ts b/js-packages/tests/eth/scheduling.test.ts index 9b19151bb7..381d013dd1 100644 --- a/js-packages/tests/eth/scheduling.test.ts +++ b/js-packages/tests/eth/scheduling.test.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; import {itSchedEth} from './util/index.js'; import {EthUniqueHelper} from './util/playgrounds/unique.dev.js'; -import {Pallets, usingPlaygrounds} from '../util/index.js'; +import {Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('Scheduing EVM smart contracts', () => { diff --git a/js-packages/tests/eth/sponsoring.test.ts b/js-packages/tests/eth/sponsoring.test.ts index 8c0b79ec1e..96c3d89072 100644 --- a/js-packages/tests/eth/sponsoring.test.ts +++ b/js-packages/tests/eth/sponsoring.test.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, expect, SponsoringMode} from './util/index.js'; -import {usingPlaygrounds} from '../util/index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; describe('EVM sponsoring', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/eth/tokenProperties.test.ts b/js-packages/tests/eth/tokenProperties.test.ts index a3be55eaaf..fde737065d 100644 --- a/js-packages/tests/eth/tokenProperties.test.ts +++ b/js-packages/tests/eth/tokenProperties.test.ts @@ -17,9 +17,9 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; import {itEth, usingEthPlaygrounds, expect} from './util/index.js'; -import type {ITokenPropertyPermission} from '@unique/playgrounds/types.js'; -import {Pallets} from '../util/index.js'; -import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '@unique/playgrounds/unique.js'; +import type {ITokenPropertyPermission} from '@unique-nft/playgrounds/types.js'; +import {Pallets} from '@unique/test-utils/util.js'; +import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '@unique-nft/playgrounds/unique.js'; import {CreateCollectionData, TokenPermissionField} from './util/playgrounds/types.js'; describe('EVM token properties', () => { diff --git a/js-packages/tests/eth/tokens/callMethodsERC20.test.ts b/js-packages/tests/eth/tokens/callMethodsERC20.test.ts index ca048efd50..48f93e4ed9 100644 --- a/js-packages/tests/eth/tokens/callMethodsERC20.test.ts +++ b/js-packages/tests/eth/tokens/callMethodsERC20.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets, requirePalletsOrSkip} from '../../util/index.js'; +import {Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from '../util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; import {CreateCollectionData} from '../util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/tokens/callMethodsERC721.test.ts b/js-packages/tests/eth/tokens/callMethodsERC721.test.ts index 37055be284..8469652d3c 100644 --- a/js-packages/tests/eth/tokens/callMethodsERC721.test.ts +++ b/js-packages/tests/eth/tokens/callMethodsERC721.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets} from '../../util/index.js'; +import {Pallets} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from '../util/index.js'; import type {IKeyringPair} from '@polkadot/types/types'; import {CreateCollectionData} from '../util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/tokens/minting.test.ts b/js-packages/tests/eth/tokens/minting.test.ts index faaf2be39e..a74b0cd7b9 100644 --- a/js-packages/tests/eth/tokens/minting.test.ts +++ b/js-packages/tests/eth/tokens/minting.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {Pallets} from '../../util/index.js'; +import {Pallets} from '@unique/test-utils/util.js'; import {expect, itEth, usingEthPlaygrounds} from '../util/index.js'; import {CreateCollectionData} from '../util/playgrounds/types.js'; diff --git a/js-packages/tests/eth/util/index.ts b/js-packages/tests/eth/util/index.ts index de521d05b5..3506ef06dd 100644 --- a/js-packages/tests/eth/util/index.ts +++ b/js-packages/tests/eth/util/index.ts @@ -7,14 +7,13 @@ import type {IKeyringPair} from '@polkadot/types/types'; import config from '../../config.js'; import {EthUniqueHelper} from './playgrounds/unique.dev.js'; -import {SilentLogger, SilentConsole} from '@unique/playgrounds/unique.dev.js'; -import {makeNames} from '../../util/index.js'; -import type {SchedKind} from '../../util/index.js'; +import {SilentLogger, SilentConsole} from '@unique/test-utils'; +import type {SchedKind} from '@unique/test-utils/util.js'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiLike from 'chai-like'; -import {getTestSeed, MINIMUM_DONOR_FUND, requirePalletsOrSkip} from '../../util/index.js'; +import {getTestSeed, MINIMUM_DONOR_FUND, requirePalletsOrSkip, makeNames} from '@unique/test-utils/util.js'; chai.use(chaiAsPromised); chai.use(chaiLike); diff --git a/js-packages/tests/eth/util/playgrounds/types.ts b/js-packages/tests/eth/util/playgrounds/types.ts index 7a251cb3fe..be40385cfd 100644 --- a/js-packages/tests/eth/util/playgrounds/types.ts +++ b/js-packages/tests/eth/util/playgrounds/types.ts @@ -1,5 +1,5 @@ -import {CollectionFlag} from '@unique/playgrounds/types.js'; -import type {TCollectionMode} from '@unique/playgrounds/types.js'; +import {CollectionFlag} from '@unique-nft/playgrounds/types.js'; +import type {TCollectionMode} from '@unique-nft/playgrounds/types.js'; export interface ContractImports { solPath: string; diff --git a/js-packages/tests/eth/util/playgrounds/unique.dev.ts b/js-packages/tests/eth/util/playgrounds/unique.dev.ts index 0041fedaee..54731ce685 100644 --- a/js-packages/tests/eth/util/playgrounds/unique.dev.ts +++ b/js-packages/tests/eth/util/playgrounds/unique.dev.ts @@ -15,7 +15,7 @@ import solc from 'solc'; import {evmToAddress} from '@polkadot/util-crypto'; import type {IKeyringPair} from '@polkadot/types/types'; -import {ArrangeGroup, DevUniqueHelper} from '@unique/playgrounds/unique.dev.js'; +import {ArrangeGroup, DevUniqueHelper} from '@unique/test-utils/index.js'; import type {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty} from './types.js'; import {CollectionMode, CreateCollectionData} from './types.js'; @@ -32,7 +32,7 @@ import refungibleDeprecatedAbi from '../../abi/reFungibleDeprecated.json' assert import refungibleTokenAbi from '../../abi/reFungibleToken.json' assert {type: 'json'}; import refungibleTokenDeprecatedAbi from '../../abi/reFungibleTokenDeprecated.json' assert {type: 'json'}; import contractHelpersAbi from '../../abi/contractHelpers.json' assert {type: 'json'}; -import type {ICrossAccountId, TEthereumAccount, TCollectionMode} from '@unique/playgrounds/types.js'; +import type {ICrossAccountId, TEthereumAccount, TCollectionMode} from '@unique-nft/playgrounds/types.js'; class EthGroupBase { helper: EthUniqueHelper; diff --git a/js-packages/tests/fungible.test.ts b/js-packages/tests/fungible.test.ts index cf4d92e419..d07270cdf0 100644 --- a/js-packages/tests/fungible.test.ts +++ b/js-packages/tests/fungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect, requirePalletsOrSkip, Pallets} from './util/index.js'; +import {itSub, usingPlaygrounds, expect, requirePalletsOrSkip, Pallets} from '@unique/test-utils/util.js'; const U128_MAX = (1n << 128n) - 1n; diff --git a/js-packages/tests/getPropertiesRpc.test.ts b/js-packages/tests/getPropertiesRpc.test.ts index aaf21f517b..015c353828 100644 --- a/js-packages/tests/getPropertiesRpc.test.ts +++ b/js-packages/tests/getPropertiesRpc.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {UniqueHelper, UniqueNFTCollection} from '@unique/playgrounds/unique.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {UniqueHelper, UniqueNFTCollection} from '@unique-nft/playgrounds/unique.js'; const collectionProps = [ {key: 'col-0', value: 'col-0-value'}, diff --git a/js-packages/tests/inflation.seqtest.ts b/js-packages/tests/inflation.seqtest.ts index a8bdad6597..a385d1b2d6 100644 --- a/js-packages/tests/inflation.seqtest.ts +++ b/js-packages/tests/inflation.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/index.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z'; diff --git a/js-packages/tests/limits.test.ts b/js-packages/tests/limits.test.ts index 012d13ccfc..f0dcb3553e 100644 --- a/js-packages/tests/limits.test.ts +++ b/js-packages/tests/limits.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js'; +import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('Number of tokens per address (NFT)', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/maintenance.seqtest.ts b/js-packages/tests/maintenance.seqtest.ts index eddc5dccc5..69a826cfea 100644 --- a/js-packages/tests/maintenance.seqtest.ts +++ b/js-packages/tests/maintenance.seqtest.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise} from '@polkadot/api'; -import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js'; +import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '@unique/test-utils/util.js'; import {itEth} from './eth/util/index.js'; import {main as correctState} from './migrations/correctStateAfterMaintenance.js'; import type {PalletBalancesIdAmount} from '@polkadot/types/lookup'; diff --git a/js-packages/tests/migrations/942057-appPromotion/index.ts b/js-packages/tests/migrations/942057-appPromotion/index.ts index cc7aea9716..60c000c5b7 100644 --- a/js-packages/tests/migrations/942057-appPromotion/index.ts +++ b/js-packages/tests/migrations/942057-appPromotion/index.ts @@ -1,4 +1,4 @@ -import type {Migration} from '../../util/frankensteinMigrate.js'; +import type {Migration} from '../index.js'; import {collectData} from './collectData.js'; import {migrateLockedToFreeze} from './lockedToFreeze.js'; diff --git a/js-packages/tests/migrations/942057-appPromotion/lockedToFreeze.ts b/js-packages/tests/migrations/942057-appPromotion/lockedToFreeze.ts index 2e1980453e..0ef3fe168e 100644 --- a/js-packages/tests/migrations/942057-appPromotion/lockedToFreeze.ts +++ b/js-packages/tests/migrations/942057-appPromotion/lockedToFreeze.ts @@ -1,6 +1,6 @@ // import { usingApi, privateKey, onlySign } from "./../../load/lib"; import * as fs from 'fs'; -import {usingPlaygrounds} from '../../util/index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; import path, {dirname} from 'path'; import {isInteger, parse} from 'lossless-json'; import {fileURLToPath} from 'url'; diff --git a/js-packages/tests/migrations/correctStateAfterMaintenance.ts b/js-packages/tests/migrations/correctStateAfterMaintenance.ts index 9428c46ffa..1cc4f62de2 100644 --- a/js-packages/tests/migrations/correctStateAfterMaintenance.ts +++ b/js-packages/tests/migrations/correctStateAfterMaintenance.ts @@ -1,5 +1,5 @@ import config from '../config.js'; -import {usingPlaygrounds} from '../util/index.js'; +import {usingPlaygrounds} from '@unique/test-utils/util.js'; import type {u32} from '@polkadot/types-codec'; const WS_ENDPOINT = config.substrateUrl; diff --git a/js-packages/tests/util/frankensteinMigrate.ts b/js-packages/tests/migrations/index.ts similarity index 65% rename from js-packages/tests/util/frankensteinMigrate.ts rename to js-packages/tests/migrations/index.ts index a17e50574f..9108f088ff 100644 --- a/js-packages/tests/util/frankensteinMigrate.ts +++ b/js-packages/tests/migrations/index.ts @@ -1,4 +1,4 @@ -import {migration as locksToFreezesMigration} from '../migrations/942057-appPromotion/index.js'; +import {migration as locksToFreezesMigration} from './942057-appPromotion/index.js'; export interface Migration { before: () => Promise, after: () => Promise, @@ -6,4 +6,4 @@ export interface Migration { export const migrations: {[key: string]: Migration} = { 'v942057': locksToFreezesMigration, -}; +}; \ No newline at end of file diff --git a/js-packages/tests/nativeFungible.test.ts b/js-packages/tests/nativeFungible.test.ts index 3a350bd60b..5504845061 100644 --- a/js-packages/tests/nativeFungible.test.ts +++ b/js-packages/tests/nativeFungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/index.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('Native fungible', () => { let root: IKeyringPair; diff --git a/js-packages/tests/nextSponsoring.test.ts b/js-packages/tests/nextSponsoring.test.ts index 42172d0256..3dbefc6444 100644 --- a/js-packages/tests/nextSponsoring.test.ts +++ b/js-packages/tests/nextSponsoring.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from './util/index.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; const SPONSORING_TIMEOUT = 5; diff --git a/js-packages/tests/package.json b/js-packages/tests/package.json index 4c81a5ddbc..722de7bac9 100644 --- a/js-packages/tests/package.json +++ b/js-packages/tests/package.json @@ -13,9 +13,9 @@ "mocha": "^10.1.0" }, "scripts": { - "setup": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ./util/globalSetup.ts", - "setIdentities": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ./util/identitySetter.ts", - "checkRelayIdentities": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ./util/relayIdentitiesChecker.ts", + "setup": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../test-utils/globalSetup.ts", + "setIdentities": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/identitySetter.ts", + "checkRelayIdentities": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/relayIdentitiesChecker.ts", "_test": "yarn setup && yarn mocha --timeout 9999999 --loader=ts-node/esm.mjs", "_testParallel": "yarn setup && yarn mocha --timeout 9999999 --parallel --loader=ts-node/esm.mjs", "test": "yarn _test './**/*.*test.ts'", diff --git a/js-packages/tests/pallet-presence.test.ts b/js-packages/tests/pallet-presence.test.ts index 05c333b3eb..51a2f13979 100644 --- a/js-packages/tests/pallet-presence.test.ts +++ b/js-packages/tests/pallet-presence.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itSub, usingPlaygrounds, expect} from './util/index.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; // Pallets that must always be present const requiredPallets = [ diff --git a/js-packages/tests/performance.seq.test.ts b/js-packages/tests/performance.seq.test.ts index 67afa31f85..d4e7b3fb99 100644 --- a/js-packages/tests/performance.seq.test.ts +++ b/js-packages/tests/performance.seq.test.ts @@ -16,9 +16,9 @@ import {ApiPromise} from '@polkadot/api'; import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/index.js'; -import type {ICrossAccountId, IProperty} from '@unique/playgrounds/types.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; +import type {ICrossAccountId, IProperty} from '@unique-nft/playgrounds/types.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; describe('Performace tests', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/refungible.test.ts b/js-packages/tests/refungible.test.ts index eb45cba9b2..2b2def90b8 100644 --- a/js-packages/tests/refungible.test.ts +++ b/js-packages/tests/refungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/index.js'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; diff --git a/js-packages/tests/removeCollectionAdmin.test.ts b/js-packages/tests/removeCollectionAdmin.test.ts index b4ece227c6..122d4faf2e 100644 --- a/js-packages/tests/removeCollectionAdmin.test.ts +++ b/js-packages/tests/removeCollectionAdmin.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/removeCollectionSponsor.test.ts b/js-packages/tests/removeCollectionSponsor.test.ts index 287c17eafe..7593960285 100644 --- a/js-packages/tests/removeCollectionSponsor.test.ts +++ b/js-packages/tests/removeCollectionSponsor.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('integration test: ext. removeCollectionSponsor():', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/rpc.test.ts b/js-packages/tests/rpc.test.ts index 01dd703ed4..13eb787b02 100644 --- a/js-packages/tests/rpc.test.ts +++ b/js-packages/tests/rpc.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from './util/index.js'; -import {ICrossAccountId} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, itSub, expect} from '@unique/test-utils/util.js'; +import {ICrossAccountId} from '@unique-nft/playgrounds/types.js'; describe('integration test: RPC methods', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/scheduler.seqtest.ts b/js-packages/tests/scheduler.seqtest.ts index d78ed3a853..8152463aa2 100644 --- a/js-packages/tests/scheduler.seqtest.ts +++ b/js-packages/tests/scheduler.seqtest.ts @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js'; +import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '@unique/test-utils/util.js'; import type {IKeyringPair} from '@polkadot/types/types'; -import {DevUniqueHelper, Event} from '@unique/playgrounds/unique.dev.js'; +import {DevUniqueHelper, Event} from '@unique/test-utils'; describe('Scheduling token and balance transfers', () => { let superuser: IKeyringPair; diff --git a/js-packages/tests/setCollectionLimits.test.ts b/js-packages/tests/setCollectionLimits.test.ts index eb00007142..e392b5c571 100644 --- a/js-packages/tests/setCollectionLimits.test.ts +++ b/js-packages/tests/setCollectionLimits.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; const accountTokenOwnershipLimit = 0; const sponsoredDataSize = 0; diff --git a/js-packages/tests/setCollectionSponsor.test.ts b/js-packages/tests/setCollectionSponsor.test.ts index 6b60cf0709..630e3eccd2 100644 --- a/js-packages/tests/setCollectionSponsor.test.ts +++ b/js-packages/tests/setCollectionSponsor.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect, Pallets} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect, Pallets} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('integration test: ext. setCollectionSponsor():', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/setPermissions.test.ts b/js-packages/tests/setPermissions.test.ts index c76212652b..c972abe2db 100644 --- a/js-packages/tests/setPermissions.test.ts +++ b/js-packages/tests/setPermissions.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test: Set Permissions', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/appPromotion/appPromotion.seqtest.ts b/js-packages/tests/sub/appPromotion/appPromotion.seqtest.ts index 192a5a645a..4d78dcfaa6 100644 --- a/js-packages/tests/sub/appPromotion/appPromotion.seqtest.ts +++ b/js-packages/tests/sub/appPromotion/appPromotion.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from '../../util/index.js'; +import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; import {expect} from '../../eth/util/index.js'; let superuser: IKeyringPair; diff --git a/js-packages/tests/sub/appPromotion/appPromotion.test.ts b/js-packages/tests/sub/appPromotion/appPromotion.test.ts index 9d3b3912fd..95265884b5 100644 --- a/js-packages/tests/sub/appPromotion/appPromotion.test.ts +++ b/js-packages/tests/sub/appPromotion/appPromotion.test.ts @@ -17,8 +17,8 @@ import type {IKeyringPair} from '@polkadot/types/types'; import { itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip, LOCKING_PERIOD, UNLOCKING_PERIOD, -} from '../../util/index.js'; -import {DevUniqueHelper} from '@unique/playgrounds/unique.dev.js'; +} from '@unique/test-utils/util.js'; +import {DevUniqueHelper} from '@unique/test-utils'; import {itEth, expect, SponsoringMode} from '../../eth/util/index.js'; let donor: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/burnItemEvent.test.ts b/js-packages/tests/sub/check-event/burnItemEvent.test.ts index 046eed43eb..3f504e669a 100644 --- a/js-packages/tests/sub/check-event/burnItemEvent.test.ts +++ b/js-packages/tests/sub/check-event/burnItemEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Burn Item event ', () => { diff --git a/js-packages/tests/sub/check-event/createCollectionEvent.test.ts b/js-packages/tests/sub/check-event/createCollectionEvent.test.ts index 68be7d5115..aec5454221 100644 --- a/js-packages/tests/sub/check-event/createCollectionEvent.test.ts +++ b/js-packages/tests/sub/check-event/createCollectionEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, itSub, expect} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Create collection event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/createItemEvent.test.ts b/js-packages/tests/sub/check-event/createItemEvent.test.ts index 9abc2e9753..6bfa4de221 100644 --- a/js-packages/tests/sub/check-event/createItemEvent.test.ts +++ b/js-packages/tests/sub/check-event/createItemEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Create Item event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/createMultipleItemsEvent.test.ts b/js-packages/tests/sub/check-event/createMultipleItemsEvent.test.ts index 92ff73f93b..318eb59e05 100644 --- a/js-packages/tests/sub/check-event/createMultipleItemsEvent.test.ts +++ b/js-packages/tests/sub/check-event/createMultipleItemsEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, itSub, expect} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Create Multiple Items Event event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/destroyCollectionEvent.test.ts b/js-packages/tests/sub/check-event/destroyCollectionEvent.test.ts index 53951f6240..bb87d273e6 100644 --- a/js-packages/tests/sub/check-event/destroyCollectionEvent.test.ts +++ b/js-packages/tests/sub/check-event/destroyCollectionEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Destroy collection event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/transferEvent.test.ts b/js-packages/tests/sub/check-event/transferEvent.test.ts index e43827ef1f..3e9c805907 100644 --- a/js-packages/tests/sub/check-event/transferEvent.test.ts +++ b/js-packages/tests/sub/check-event/transferEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Transfer event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/check-event/transferFromEvent.test.ts b/js-packages/tests/sub/check-event/transferFromEvent.test.ts index f6fd282955..1195efc037 100644 --- a/js-packages/tests/sub/check-event/transferFromEvent.test.ts +++ b/js-packages/tests/sub/check-event/transferFromEvent.test.ts @@ -16,8 +16,8 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../../util/index.js'; -import type {IEvent} from '@unique/playgrounds/types.js'; +import {usingPlaygrounds, expect, itSub} from '@unique/test-utils/util.js'; +import type {IEvent} from '@unique-nft/playgrounds/types.js'; describe('Transfer event ', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/collator-selection/collatorSelection.seqtest.ts b/js-packages/tests/sub/collator-selection/collatorSelection.seqtest.ts index b7302a13af..ee98c47b4c 100644 --- a/js-packages/tests/sub/collator-selection/collatorSelection.seqtest.ts +++ b/js-packages/tests/sub/collator-selection/collatorSelection.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../../util/index.js'; +import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; async function nodeAddress(name: string) { // eslint-disable-next-line require-await diff --git a/js-packages/tests/sub/collator-selection/identity.seqtest.ts b/js-packages/tests/sub/collator-selection/identity.seqtest.ts index c041906616..29c9ce92b4 100644 --- a/js-packages/tests/sub/collator-selection/identity.seqtest.ts +++ b/js-packages/tests/sub/collator-selection/identity.seqtest.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../../util/index.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; +import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '@unique/test-utils/util.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; async function getIdentities(helper: UniqueHelper) { const identities: [string, any][] = []; diff --git a/js-packages/tests/sub/governance/council.test.ts b/js-packages/tests/sub/governance/council.test.ts index d1f4bbe38d..ce17963793 100644 --- a/js-packages/tests/sub/governance/council.test.ts +++ b/js-packages/tests/sub/governance/council.test.ts @@ -1,7 +1,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; +import {Event} from '@unique/test-utils'; import {initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, councilMotionDuration, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, initTechComm, clearFellowship, dummyProposal, dummyProposalCall, initFellowship, defaultEnactmentMoment, fellowshipPropositionOrigin} from './util.js'; import type {ICounselors} from './util.js'; diff --git a/js-packages/tests/sub/governance/democracy.test.ts b/js-packages/tests/sub/governance/democracy.test.ts index ae5bd89c1b..37f91a6be9 100644 --- a/js-packages/tests/sub/governance/democracy.test.ts +++ b/js-packages/tests/sub/governance/democracy.test.ts @@ -1,7 +1,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; import {clearFellowship, democracyLaunchPeriod, democracyTrackMinRank, dummyProposalCall, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, fellowshipPreparePeriod, fellowshipPropositionOrigin, initFellowship, voteUnanimouslyInFellowship} from './util.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {Event} from '@unique/test-utils'; describeGov('Governance: Democracy tests', () => { let regularUser: IKeyringPair; diff --git a/js-packages/tests/sub/governance/electsudo.test.ts b/js-packages/tests/sub/governance/electsudo.test.ts index 8f134b4f78..dd5566c941 100644 --- a/js-packages/tests/sub/governance/electsudo.test.ts +++ b/js-packages/tests/sub/governance/electsudo.test.ts @@ -1,6 +1,6 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; +import {Event} from '@unique/test-utils'; import {initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, clearCouncil, clearTechComm, initTechComm, ITechComms} from './util.js'; import type {ICounselors} from './util.js'; diff --git a/js-packages/tests/sub/governance/fellowship.test.ts b/js-packages/tests/sub/governance/fellowship.test.ts index 649ad1e054..f44126b528 100644 --- a/js-packages/tests/sub/governance/fellowship.test.ts +++ b/js-packages/tests/sub/governance/fellowship.test.ts @@ -1,6 +1,6 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; -import {DevUniqueHelper, Event} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; +import {DevUniqueHelper, Event} from '@unique/test-utils'; import {initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, voteUnanimouslyInFellowship, democracyTrackMinRank, fellowshipPreparePeriod, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, democracyTrackId, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util.js'; import type {ICounselors, ITechComms} from './util.js'; diff --git a/js-packages/tests/sub/governance/init.test.ts b/js-packages/tests/sub/governance/init.test.ts index fe6f44a67b..9b4c645f22 100644 --- a/js-packages/tests/sub/governance/init.test.ts +++ b/js-packages/tests/sub/governance/init.test.ts @@ -1,6 +1,6 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; +import {Event} from '@unique/test-utils'; import {democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, clearCouncil, clearTechComm, clearFellowship} from './util.js'; import type {ICounselors, ITechComms} from './util.js'; diff --git a/js-packages/tests/sub/governance/technicalCommittee.test.ts b/js-packages/tests/sub/governance/technicalCommittee.test.ts index 0fe8badde1..1fe8cc65d0 100644 --- a/js-packages/tests/sub/governance/technicalCommittee.test.ts +++ b/js-packages/tests/sub/governance/technicalCommittee.test.ts @@ -1,6 +1,6 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../../util/index.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js'; +import {Event} from '@unique/test-utils'; import {initCouncil, democracyLaunchPeriod, democracyFastTrackVotingPeriod, clearCouncil, clearTechComm, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util.js'; import type {ITechComms} from './util.js'; diff --git a/js-packages/tests/sub/governance/util.ts b/js-packages/tests/sub/governance/util.ts index bbebc56449..0e57cb3b1a 100644 --- a/js-packages/tests/sub/governance/util.ts +++ b/js-packages/tests/sub/governance/util.ts @@ -1,9 +1,9 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {xxhashAsHex} from '@polkadot/util-crypto'; import type {u32} from '@polkadot/types-codec'; -import {usingPlaygrounds, expect} from '../../util/index.js'; -import {UniqueHelper} from '@unique/playgrounds/unique.js'; -import {DevUniqueHelper} from '@unique/playgrounds/unique.dev.js'; +import {usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {UniqueHelper} from '@unique-nft/playgrounds/unique.js'; +import {DevUniqueHelper} from '@unique/test-utils'; export const democracyLaunchPeriod = 35; export const democracyVotingPeriod = 35; diff --git a/js-packages/tests/sub/nesting/admin.test.ts b/js-packages/tests/sub/nesting/admin.test.ts index 5734806f2a..8ac9be23c6 100644 --- a/js-packages/tests/sub/nesting/admin.test.ts +++ b/js-packages/tests/sub/nesting/admin.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../../util/index.js'; -import {CrossAccountId} from '@unique/playgrounds/unique.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId} from '@unique-nft/playgrounds/unique.js'; describe('Nesting by collection admin', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/collectionProperties.seqtest.ts b/js-packages/tests/sub/nesting/collectionProperties.seqtest.ts index 16d9c99781..ec373c99f2 100644 --- a/js-packages/tests/sub/nesting/collectionProperties.seqtest.ts +++ b/js-packages/tests/sub/nesting/collectionProperties.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../../util/index.js'; +import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '@unique/test-utils/util.js'; describe('Integration Test: Collection Properties with sudo', () => { let superuser: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/collectionProperties.test.ts b/js-packages/tests/sub/nesting/collectionProperties.test.ts index 076f7c2578..9a0896f0b8 100644 --- a/js-packages/tests/sub/nesting/collectionProperties.test.ts +++ b/js-packages/tests/sub/nesting/collectionProperties.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../../util/index.js'; +import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '@unique/test-utils/util.js'; describe('Integration Test: Collection Properties', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/common.test.ts b/js-packages/tests/sub/nesting/common.test.ts index c104f526dc..aaf8435af9 100644 --- a/js-packages/tests/sub/nesting/common.test.ts +++ b/js-packages/tests/sub/nesting/common.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js'; -import {CrossAccountId, UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/unique.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId, UniqueNFTCollection, UniqueRFTCollection} from '@unique-nft/playgrounds/unique.js'; let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/e2e.test.ts b/js-packages/tests/sub/nesting/e2e.test.ts index badda2eaec..dbc0baea51 100644 --- a/js-packages/tests/sub/nesting/e2e.test.ts +++ b/js-packages/tests/sub/nesting/e2e.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../../util/index.js'; -import {CrossAccountId} from '@unique/playgrounds/unique.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId} from '@unique-nft/playgrounds/unique.js'; describe('Composite nesting tests', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/graphs.test.ts b/js-packages/tests/sub/nesting/graphs.test.ts index 23df4c01fc..d1a0c551cd 100644 --- a/js-packages/tests/sub/nesting/graphs.test.ts +++ b/js-packages/tests/sub/nesting/graphs.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../../util/index.js'; -import {UniqueHelper, UniqueNFTCollection, UniqueNFToken} from '@unique/playgrounds/unique.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {UniqueHelper, UniqueNFTCollection, UniqueNFToken} from '@unique-nft/playgrounds/unique.js'; /** * ```dot diff --git a/js-packages/tests/sub/nesting/nesting.negative.test.ts b/js-packages/tests/sub/nesting/nesting.negative.test.ts index cfb7e7fa65..e2be5ca47f 100644 --- a/js-packages/tests/sub/nesting/nesting.negative.test.ts +++ b/js-packages/tests/sub/nesting/nesting.negative.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js'; -import {UniqueFTCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '@unique/playgrounds/unique.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {UniqueFTCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '@unique-nft/playgrounds/unique.js'; import {itEth} from '../../eth/util/index.js'; let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/propertyPermissions.test.ts b/js-packages/tests/sub/nesting/propertyPermissions.test.ts index fc9de22797..e936b5fa38 100644 --- a/js-packages/tests/sub/nesting/propertyPermissions.test.ts +++ b/js-packages/tests/sub/nesting/propertyPermissions.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect} from '../../util/index.js'; -import {UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/unique.js'; +import {itSub, Pallets, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {UniqueNFTCollection, UniqueRFTCollection} from '@unique-nft/playgrounds/unique.js'; describe('Integration Test: Access Rights to Token Properties', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/refungible.test.ts b/js-packages/tests/sub/nesting/refungible.test.ts index 019472ae7f..ae45a213ed 100644 --- a/js-packages/tests/sub/nesting/refungible.test.ts +++ b/js-packages/tests/sub/nesting/refungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('ReFungible-specific nesting tests', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/tokenProperties.seqtest.ts b/js-packages/tests/sub/nesting/tokenProperties.seqtest.ts index c864ddfdf4..7513d1dc2f 100644 --- a/js-packages/tests/sub/nesting/tokenProperties.seqtest.ts +++ b/js-packages/tests/sub/nesting/tokenProperties.seqtest.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../../util/index.js'; +import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '@unique/test-utils/util.js'; describe('Integration Test: Token Properties with sudo', () => { let superuser: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/tokenProperties.test.ts b/js-packages/tests/sub/nesting/tokenProperties.test.ts index 6ba079a565..620847bb86 100644 --- a/js-packages/tests/sub/nesting/tokenProperties.test.ts +++ b/js-packages/tests/sub/nesting/tokenProperties.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect, sizeOfProperty} from '../../util/index.js'; -import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '@unique/playgrounds/unique.js'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect, sizeOfProperty} from '@unique/test-utils/util.js'; +import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '@unique-nft/playgrounds/unique.js'; describe('Integration Test: Token Properties', () => { let alice: IKeyringPair; // collection owner diff --git a/js-packages/tests/sub/nesting/unnest.test.ts b/js-packages/tests/sub/nesting/unnest.test.ts index 85156ff996..7a1eb18c27 100644 --- a/js-packages/tests/sub/nesting/unnest.test.ts +++ b/js-packages/tests/sub/nesting/unnest.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js'; -import {CrossAccountId, UniqueFTCollection, UniqueNFToken, UniqueRFToken} from '@unique/playgrounds/unique.js'; +import {expect, itSub, Pallets, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId, UniqueFTCollection, UniqueNFToken, UniqueRFToken} from '@unique-nft/playgrounds/unique.js'; describe('Integration Test: Unnesting', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/nesting/unnesting.negative.test.ts b/js-packages/tests/sub/nesting/unnesting.negative.test.ts index 997264faf4..32d16bc52e 100644 --- a/js-packages/tests/sub/nesting/unnesting.negative.test.ts +++ b/js-packages/tests/sub/nesting/unnesting.negative.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../../util/index.js'; -import {CrossAccountId} from '@unique/playgrounds/unique.js'; +import {expect, itSub, usingPlaygrounds} from '@unique/test-utils/util.js'; +import {CrossAccountId} from '@unique-nft/playgrounds/unique.js'; describe('Negative Test: Unnesting', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/refungible/burn.test.ts b/js-packages/tests/sub/refungible/burn.test.ts index 7f9d6fe2bd..4cee1cb9a6 100644 --- a/js-packages/tests/sub/refungible/burn.test.ts +++ b/js-packages/tests/sub/refungible/burn.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; describe('Refungible: burn', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/sub/refungible/nesting.test.ts b/js-packages/tests/sub/refungible/nesting.test.ts index bec9455570..7c1644d9cb 100644 --- a/js-packages/tests/sub/refungible/nesting.test.ts +++ b/js-packages/tests/sub/refungible/nesting.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../../util/index.js'; +import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '@unique/test-utils/util.js'; describe('Refungible nesting', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/sub/refungible/repartition.test.ts b/js-packages/tests/sub/refungible/repartition.test.ts index f678eb42d9..648761f8ba 100644 --- a/js-packages/tests/sub/refungible/repartition.test.ts +++ b/js-packages/tests/sub/refungible/repartition.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; describe('integration test: Refungible functionality:', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/sub/refungible/transfer.test.ts b/js-packages/tests/sub/refungible/transfer.test.ts index 4aef955a56..6ab8d4b1fc 100644 --- a/js-packages/tests/sub/refungible/transfer.test.ts +++ b/js-packages/tests/sub/refungible/transfer.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; describe('Refungible transfer tests', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/transfer.test.ts b/js-packages/tests/transfer.test.ts index cb9cafe83d..9a07a7e6cb 100644 --- a/js-packages/tests/transfer.test.ts +++ b/js-packages/tests/transfer.test.ts @@ -16,8 +16,8 @@ import type {IKeyringPair} from '@polkadot/types/types'; import {itEth, usingEthPlaygrounds} from './eth/util/index.js'; -import {itSub, Pallets, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, Pallets, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/transferFrom.test.ts b/js-packages/tests/transferFrom.test.ts index d791a054f7..277693e7a5 100644 --- a/js-packages/tests/transferFrom.test.ts +++ b/js-packages/tests/transferFrom.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect} from './util/index.js'; -import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/types.js'; +import {itSub, Pallets, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; +import {NON_EXISTENT_COLLECTION_ID} from '@unique-nft/playgrounds/types.js'; describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => { let alice: IKeyringPair; diff --git a/js-packages/tests/tx-version-presence.test.ts b/js-packages/tests/tx-version-presence.test.ts index 5671fe59be..31698767a6 100644 --- a/js-packages/tests/tx-version-presence.test.ts +++ b/js-packages/tests/tx-version-presence.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {Metadata} from '@polkadot/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; let metadata: Metadata; diff --git a/js-packages/tests/vesting.test.ts b/js-packages/tests/vesting.test.ts index a9a59f0dc1..3ac99babee 100644 --- a/js-packages/tests/vesting.test.ts +++ b/js-packages/tests/vesting.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/index.js'; +import {itSub, usingPlaygrounds, expect} from '@unique/test-utils/util.js'; describe('Vesting', () => { let donor: IKeyringPair; diff --git a/js-packages/tests/xcm/lowLevelXcmQuartz.test.ts b/js-packages/tests/xcm/lowLevelXcmQuartz.test.ts index ef9453a321..2d7de1a593 100644 --- a/js-packages/tests/xcm/lowLevelXcmQuartz.test.ts +++ b/js-packages/tests/xcm/lowLevelXcmQuartz.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingMoonriverPlaygrounds, usingShidenPlaygrounds, usingRelayPlaygrounds} from '../util/index.js'; +import {itSub, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingMoonriverPlaygrounds, usingShidenPlaygrounds} from '@unique/test-utils/util.js'; import {QUARTZ_CHAIN, QTZ_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, shidenUrl, SAFE_XCM_VERSION, XcmTestHelper, TRANSFER_AMOUNT, SENDER_BUDGET, relayUrl} from './xcm.types.js'; import {hexToString} from '@polkadot/util'; diff --git a/js-packages/tests/xcm/lowLevelXcmUnique.test.ts b/js-packages/tests/xcm/lowLevelXcmUnique.test.ts index 89945936cb..0ac532e4e9 100644 --- a/js-packages/tests/xcm/lowLevelXcmUnique.test.ts +++ b/js-packages/tests/xcm/lowLevelXcmUnique.test.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import config from '../config.js'; -import {itSub, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingMoonbeamPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds, usingHydraDxPlaygrounds} from '../util/index.js'; +import {itSub, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingMoonbeamPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds, usingHydraDxPlaygrounds} from '@unique/test-utils/util.js'; import {nToBigInt} from '@polkadot/util'; import {hexToString} from '@polkadot/util'; import {ASTAR_DECIMALS, SAFE_XCM_VERSION, SENDER_BUDGET, UNIQUE_CHAIN, UNQ_DECIMALS, XcmTestHelper, acalaUrl, astarUrl, hydraDxUrl, moonbeamUrl, polkadexUrl, uniqueAssetId} from './xcm.types.js'; diff --git a/js-packages/tests/xcm/xcm.types.ts b/js-packages/tests/xcm/xcm.types.ts index 2dc09f5e52..e0a304f47c 100644 --- a/js-packages/tests/xcm/xcm.types.ts +++ b/js-packages/tests/xcm/xcm.types.ts @@ -1,7 +1,6 @@ import type {IKeyringPair} from '@polkadot/types/types'; -import {hexToString} from '@polkadot/util'; -import {expect, usingAcalaPlaygrounds, usingAstarPlaygrounds, usingHydraDxPlaygrounds, usingKaruraPlaygrounds, usingMoonbeamPlaygrounds, usingMoonriverPlaygrounds, usingPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds, usingShidenPlaygrounds} from '../util/index.js'; -import {DevUniqueHelper, Event} from '@unique/playgrounds/unique.dev.js'; +import {expect, usingAcalaPlaygrounds, usingAstarPlaygrounds, usingHydraDxPlaygrounds, usingKaruraPlaygrounds, usingMoonbeamPlaygrounds, usingMoonriverPlaygrounds, usingPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds, usingShidenPlaygrounds} from '@unique/test-utils/util.js'; +import {DevUniqueHelper, Event} from '@unique/test-utils'; import config from '../config.js'; export const UNIQUE_CHAIN = +(process.env.RELAY_UNIQUE_ID || 2037); diff --git a/js-packages/tests/xcm/xcmOpal.test.ts b/js-packages/tests/xcm/xcmOpal.test.ts index 46b6531746..28db4f2484 100644 --- a/js-packages/tests/xcm/xcmOpal.test.ts +++ b/js-packages/tests/xcm/xcmOpal.test.ts @@ -16,7 +16,7 @@ import type {IKeyringPair} from '@polkadot/types/types'; import config from '../config.js'; -import {itSub, expect, describeXCM, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/index.js'; +import {itSub, expect, describeXCM, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '@unique/test-utils/util.js'; import {XcmTestHelper} from './xcm.types.js'; const STATEMINE_CHAIN = +(process.env.RELAY_WESTMINT_ID || 1000); diff --git a/js-packages/tests/xcm/xcmQuartz.test.ts b/js-packages/tests/xcm/xcmQuartz.test.ts index fe9f6efa9c..67dc5afaa8 100644 --- a/js-packages/tests/xcm/xcmQuartz.test.ts +++ b/js-packages/tests/xcm/xcmQuartz.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import type {IKeyringPair} from '@polkadot/types/types'; -import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util/index.js'; -import {DevUniqueHelper, Event} from '@unique/playgrounds/unique.dev.js'; +import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '@unique/test-utils/util.js'; +import {DevUniqueHelper, Event} from '@unique/test-utils'; import {STATEMINE_CHAIN, QUARTZ_CHAIN, KARURA_CHAIN, MOONRIVER_CHAIN, SHIDEN_CHAIN, STATEMINE_DECIMALS, KARURA_DECIMALS, QTZ_DECIMALS, RELAY_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, relayUrl, shidenUrl, statemineUrl} from './xcm.types.js'; import {hexToString} from '@polkadot/util'; import {XcmTestHelper} from './xcm.types.js'; diff --git a/js-packages/tests/xcm/xcmUnique.test.ts b/js-packages/tests/xcm/xcmUnique.test.ts index af2778c83a..1df2091d6d 100644 --- a/js-packages/tests/xcm/xcmUnique.test.ts +++ b/js-packages/tests/xcm/xcmUnique.test.ts @@ -16,8 +16,8 @@ import type {IKeyringPair} from '@polkadot/types/types'; import config from '../config.js'; -import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds} from '../util/index.js'; -import {Event} from '@unique/playgrounds/unique.dev.js'; +import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds} from '@unique/test-utils/util.js'; +import {Event} from '@unique/test-utils'; import {hexToString, nToBigInt} from '@polkadot/util'; import {ACALA_CHAIN, ASTAR_CHAIN, MOONBEAM_CHAIN, POLKADEX_CHAIN, SAFE_XCM_VERSION, STATEMINT_CHAIN, UNIQUE_CHAIN, expectFailedToTransact, expectUntrustedReserveLocationFail, uniqueAssetId, uniqueVersionedMultilocation} from './xcm.types.js'; import {XcmTestHelper} from './xcm.types.js'; diff --git a/js-packages/types/package.json b/js-packages/types/package.json index c96323229d..5d3364fd2f 100644 --- a/js-packages/types/package.json +++ b/js-packages/types/package.json @@ -5,7 +5,7 @@ "engines": { "node": ">=16" }, - "name": "@unique/opal-types", + "name": "@unique-nft/opal-testnet-types", "type": "module", "version": "1.0.0", "main": "index.js", diff --git a/js-packages/yarn.lock b/js-packages/yarn.lock index 6d35f99181..1cb7f14e42 100644 --- a/js-packages/yarn.lock +++ b/js-packages/yarn.lock @@ -1242,22 +1242,21 @@ __metadata: languageName: node linkType: hard -"@unique/opal-types@workspace:*, @unique/opal-types@workspace:types": +"@unique-nft/opal-testnet-types@workspace:*, @unique-nft/opal-testnet-types@workspace:types": version: 0.0.0-use.local - resolution: "@unique/opal-types@workspace:types" + resolution: "@unique-nft/opal-testnet-types@workspace:types" dependencies: "@polkadot/typegen": ^10.10.1 languageName: unknown linkType: soft -"@unique/playgrounds@workspace:*, @unique/playgrounds@workspace:playgrounds": +"@unique-nft/playgrounds@workspace:*, @unique-nft/playgrounds@workspace:playgrounds": version: 0.0.0-use.local - resolution: "@unique/playgrounds@workspace:playgrounds" + resolution: "@unique-nft/playgrounds@workspace:playgrounds" dependencies: "@polkadot/api": 10.10.1 "@polkadot/util": ^12.5.1 "@polkadot/util-crypto": ^12.5.1 - "@unique/opal-types": "workspace:*" languageName: unknown linkType: soft @@ -1267,6 +1266,17 @@ __metadata: languageName: unknown linkType: soft +"@unique/test-utils@workspace:*, @unique/test-utils@workspace:test-utils": + version: 0.0.0-use.local + resolution: "@unique/test-utils@workspace:test-utils" + dependencies: + "@polkadot/api": 10.10.1 + "@polkadot/util": ^12.5.1 + "@polkadot/util-crypto": ^12.5.1 + "@unique-nft/opal-testnet-types": "workspace:*" + languageName: unknown + linkType: soft + "@unique/tests@workspace:tests": version: 0.0.0-use.local resolution: "@unique/tests@workspace:tests" @@ -6001,8 +6011,9 @@ __metadata: "@types/node": ^20.8.10 "@typescript-eslint/eslint-plugin": ^6.10.0 "@typescript-eslint/parser": ^6.10.0 - "@unique/opal-types": "workspace:*" - "@unique/playgrounds": "workspace:*" + "@unique-nft/opal-testnet-types": "workspace:*" + "@unique-nft/playgrounds": "workspace:*" + "@unique/test-utils": "workspace:*" chai: ^4.3.10 chai-as-promised: ^7.1.1 chai-like: ^1.1.1